Skip to content

Commit bd8fc3a

Browse files
authored
Apply latest rector fixes (#1777)
1 parent 44f70c6 commit bd8fc3a

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

examples/05-type-config-decorator/app/Models/Author.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ final class Author extends Model
1313
*/
1414
public static function find(int $id): array
1515
{
16-
return static::get("author/{$id}");
16+
return self::get("author/{$id}");
1717
}
1818
}

src/Language/Lexer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,7 @@ private function positionAfterWhitespace(): void
624624

625625
// Skip whitespace
626626
// tab | space | comma | BOM
627-
if ($code === 9 || $code === 32 || $code === 44 || $code === 0xFEFF) {
627+
if (in_array($code, [9, 32, 44, 0xFEFF], true)) {
628628
$this->moveStringCursor(1, $bytes);
629629
} elseif ($code === 10) { // new line
630630
$this->moveStringCursor(1, $bytes);

src/Type/SchemaValidationContext.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -769,7 +769,7 @@ private function validateEnumValues(EnumType $enumType): void
769769

770770
// Ensure valid name.
771771
$this->validateName($enumValue);
772-
if ($valueName === 'true' || $valueName === 'false' || $valueName === 'null') {
772+
if (in_array($valueName, ['true', 'false', 'null'], true)) {
773773
$this->reportError(
774774
"Enum type {$enumType->name} cannot include value: {$valueName}.",
775775
$enumValue->astNode

src/Utils/SchemaExtender.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -564,13 +564,13 @@ protected function extendInterfaceType(InterfaceType $type): InterfaceType
564564
protected function isSpecifiedScalarType(Type $type): bool
565565
{
566566
return $type instanceof NamedType
567-
&& (
568-
$type->name === Type::STRING
569-
|| $type->name === Type::INT
570-
|| $type->name === Type::FLOAT
571-
|| $type->name === Type::BOOLEAN
572-
|| $type->name === Type::ID
573-
);
567+
&& in_array($type->name, [
568+
Type::STRING,
569+
Type::INT,
570+
Type::FLOAT,
571+
Type::BOOLEAN,
572+
Type::ID,
573+
], true);
574574
}
575575

576576
/**

tests/Utils/SchemaExtenderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1769,7 +1769,7 @@ public function testShouldBeAbleToIntroduceNewTypesThroughExtension(): void
17691769
$extendedDocumentNode = Parser::parse($extensionSdl);
17701770
$extendedSchema = SchemaExtender::extend($schema, $extendedDocumentNode);
17711771

1772-
static::assertSame(
1772+
self::assertSame(
17731773
<<<GRAPHQL
17741774
type Query {
17751775
defaultValue: String

0 commit comments

Comments
 (0)