Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/05-type-config-decorator/app/Models/Author.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ final class Author extends Model
*/
public static function find(int $id): array
{
return static::get("author/{$id}");
return self::get("author/{$id}");
}
}
2 changes: 1 addition & 1 deletion src/Language/Lexer.php
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@ private function positionAfterWhitespace(): void

// Skip whitespace
// tab | space | comma | BOM
if ($code === 9 || $code === 32 || $code === 44 || $code === 0xFEFF) {
if (in_array($code, [9, 32, 44, 0xFEFF], true)) {
$this->moveStringCursor(1, $bytes);
} elseif ($code === 10) { // new line
$this->moveStringCursor(1, $bytes);
Expand Down
2 changes: 1 addition & 1 deletion src/Type/SchemaValidationContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,7 @@ private function validateEnumValues(EnumType $enumType): void

// Ensure valid name.
$this->validateName($enumValue);
if ($valueName === 'true' || $valueName === 'false' || $valueName === 'null') {
if (in_array($valueName, ['true', 'false', 'null'], true)) {
$this->reportError(
"Enum type {$enumType->name} cannot include value: {$valueName}.",
$enumValue->astNode
Expand Down
14 changes: 7 additions & 7 deletions src/Utils/SchemaExtender.php
Original file line number Diff line number Diff line change
Expand Up @@ -564,13 +564,13 @@ protected function extendInterfaceType(InterfaceType $type): InterfaceType
protected function isSpecifiedScalarType(Type $type): bool
{
return $type instanceof NamedType
&& (
$type->name === Type::STRING
|| $type->name === Type::INT
|| $type->name === Type::FLOAT
|| $type->name === Type::BOOLEAN
|| $type->name === Type::ID
);
&& in_array($type->name, [
Type::STRING,
Type::INT,
Type::FLOAT,
Type::BOOLEAN,
Type::ID,
], true);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/Utils/SchemaExtenderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1769,7 +1769,7 @@ public function testShouldBeAbleToIntroduceNewTypesThroughExtension(): void
$extendedDocumentNode = Parser::parse($extensionSdl);
$extendedSchema = SchemaExtender::extend($schema, $extendedDocumentNode);

static::assertSame(
self::assertSame(
<<<GRAPHQL
type Query {
defaultValue: String
Expand Down
Loading