Skip to content

Commit 5957b9d

Browse files
authored
Rector / CS fixes (#1979)
1 parent f696fdb commit 5957b9d

8 files changed

Lines changed: 9 additions & 9 deletions

File tree

.php-cs-fixer.dist.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
'ordered_imports' => true,
3939
'no_unused_imports' => true,
4040
'blank_line_before_statement' => ['statements' => ['return']],
41-
'visibility_required' => true,
41+
'modifier_keywords' => true,
4242
'cast_spaces' => ['space' => 'single'],
4343
'concat_space' => ['spacing' => 'one'],
4444
'type_declaration_spaces' => true,

src/Analysis.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public function addAnnotation(OA\AbstractAnnotation $annotation, Context $contex
7171
$context->annotations = [];
7272
}
7373

74-
if (in_array($annotation, $context->annotations, true) === false) {
74+
if (in_array($annotation, $context->annotations, strict: true) === false) {
7575
$context->annotations[] = $annotation;
7676
}
7777
}

src/Annotations/AbstractAnnotation.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ private function validateValueType(string $type, mixed $value): bool
448448
'number' => is_numeric($value),
449449
'object' => is_object($value),
450450
'array' => is_array($value) && array_is_list($value),
451-
'scheme' => in_array($value, ['http', 'https', 'ws', 'wss'], true),
451+
'scheme' => in_array($value, ['http', 'https', 'ws', 'wss'], strict: true),
452452
default => throw new OpenApiException('Invalid type "' . $type . '"'),
453453
};
454454

src/Annotations/Schema.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ public function isNullable(): bool
353353
*/
354354
public function hasType(string $type): bool
355355
{
356-
return in_array($type, (array) $this->type, true);
356+
return in_array($type, (array) $this->type, strict: true);
357357
}
358358

359359
public function jsonSerialize(): \stdClass

src/Loggers/ConsoleLogger.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public function log($level, $message, array $context = []): void
6666
}
6767
$stop = empty($color) ? '' : static::COLOR_STOP;
6868

69-
if (!in_array($level, self::LOG_LEVELS_UP_TO_NOTICE, true)) {
69+
if (!in_array($level, self::LOG_LEVELS_UP_TO_NOTICE, strict: true)) {
7070
$this->loggedMessageAboveNotice = true;
7171
}
7272

src/Processors/Concerns/MergePropertiesTrait.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ protected function mergeProperties(OA\Schema $schema, array $from, array &$exist
4040
foreach ($from['properties'] as $context) {
4141
if (is_iterable($context->annotations)) {
4242
foreach ($context->annotations as $annotation) {
43-
if ($annotation instanceof OA\Property && !in_array($annotation->_context->property, $existing, true)) {
43+
if ($annotation instanceof OA\Property && !in_array($annotation->_context->property, $existing, strict: true)) {
4444
$existing[] = $annotation->_context->property;
4545
$schema->merge([$annotation], true);
4646
}
@@ -54,7 +54,7 @@ protected function mergeMethods(OA\Schema $schema, array $from, array &$existing
5454
foreach ($from['methods'] as $context) {
5555
if (is_iterable($context->annotations)) {
5656
foreach ($context->annotations as $annotation) {
57-
if ($annotation instanceof OA\Property && !in_array($annotation->_context->property, $existing, true)) {
57+
if ($annotation instanceof OA\Property && !in_array($annotation->_context->property, $existing, strict: true)) {
5858
$existing[] = $annotation->_context->property;
5959
$schema->merge([$annotation], true);
6060
}

src/Serializer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public function deserializeFile(string $filename, string $format = 'json', strin
9797
$contents = file_get_contents($filename);
9898

9999
$ext = pathinfo($filename, PATHINFO_EXTENSION);
100-
if ('yaml' === $format || in_array($ext, ['yml', 'yaml'])) {
100+
if ('yaml' === $format || in_array($ext, ['yml', 'yaml'], strict: true)) {
101101
$contents = json_encode(Yaml::parse($contents));
102102
}
103103

src/Type/LegacyTypeResolver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ protected function augmentItems(OA\Schema $schema, Analysis $analysis): void
103103

104104
protected function normaliseTypeResult(?string $explicitType = null, ?array $explicitDetails = null, array $types = [], ?string $name = null, ?bool $nullable = null, ?bool $isArray = null, bool $unsupported = false, ?Context $context = null): \stdClass
105105
{
106-
$types = array_filter($types, static fn (string $t): bool => !in_array($t, ['null', '']));
106+
$types = array_filter($types, static fn (string $t): bool => !in_array($t, ['null', ''], strict: true));
107107

108108
if ($context) {
109109
foreach ($types as $ii => $type) {

0 commit comments

Comments
 (0)