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 tests/Executor/DeferredFieldsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ final class DeferredFieldsTest extends TestCase

private ObjectType $queryType;

public function setUp(): void
protected function setUp(): void
{
$this->storyDataSource = [
['id' => 1, 'authorId' => 1, 'title' => 'Story #1', 'categoryIds' => [2, 3]],
Expand Down
2 changes: 1 addition & 1 deletion tests/Executor/ListsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ public function testHandlesNonNullListOfNonNullsWithArray(): void
* @throws \Exception
* @throws InvariantViolation
*/
public function checkHandlesNonNullListOfNonNulls($testData, array $expected, int $debug = DebugFlag::NONE): void
private function checkHandlesNonNullListOfNonNulls($testData, array $expected, int $debug = DebugFlag::NONE): void
{
$testType = Type::nonNull(Type::listOf(Type::nonNull(Type::int())));
$this->check($testType, $testData, $expected, $debug);
Expand Down
2 changes: 1 addition & 1 deletion tests/Executor/NonNullTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ final class NonNullTest extends TestCase

public Schema $schemaWithNonNullArg;

public function setUp(): void
protected function setUp(): void
{
$this->syncError = new UserError('sync');
$this->syncNonNullError = new UserError('syncNonNull');
Expand Down
2 changes: 1 addition & 1 deletion tests/Executor/Promise/ReactPromiseAdapterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ final class ReactPromiseAdapterTest extends TestCase
/** @var class-string<object> */
private string $classRejectedPromise;

public function setUp(): void
protected function setUp(): void
{
/** @var class-string<object> $classFulfilledPromise */
$classFulfilledPromise = class_exists('\React\Promise\FulfilledPromise')
Expand Down
2 changes: 1 addition & 1 deletion tests/Executor/Promise/SyncPromiseAdapterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ final class SyncPromiseAdapterTest extends TestCase
{
private SyncPromiseAdapter $promises;

public function setUp(): void
protected function setUp(): void
{
$this->promises = new SyncPromiseAdapter();
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Executor/ScopedContextTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ final class ScopedContextTest extends TestCase
/** @var array<string, MyScopedContext|MySharedContext> */
private array $contexts = [];

public function setUp(): void
protected function setUp(): void
{
$this->contexts = [];

Expand Down
2 changes: 1 addition & 1 deletion tests/Executor/SyncTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ final class SyncTest extends TestCase

private SyncPromiseAdapter $promiseAdapter;

public function setUp(): void
protected function setUp(): void
{
$this->schema = new Schema([
'query' => new ObjectType([
Expand Down
3 changes: 1 addition & 2 deletions tests/Executor/TestClasses/Human.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@

final class Human
{
/** @var string */
public $name;
public string $name;

public function __construct(string $name)
{
Expand Down
6 changes: 2 additions & 4 deletions tests/Executor/TestClasses/NotSpecial.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@

final class NotSpecial
{
/** @var string */
public $value;
public string $value;

/** @param string $value */
public function __construct($value)
public function __construct(string $value)
{
$this->value = $value;
}
Expand Down
3 changes: 1 addition & 2 deletions tests/Executor/TestClasses/NumberHolder.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@

final class NumberHolder
{
/** @var float */
public $theNumber;
public float $theNumber;

public function __construct(float $originalNumber)
{
Expand Down
3 changes: 1 addition & 2 deletions tests/Executor/TestClasses/Person.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@

final class Person
{
/** @var string */
public $name;
public string $name;

/** @var array<Dog|Cat>|null */
public ?array $pets;
Expand Down
6 changes: 2 additions & 4 deletions tests/Executor/TestClasses/Special.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@

final class Special
{
/** @var string */
public $value;
public string $value;

/** @param string $value */
public function __construct($value)
public function __construct(string $value)
{
$this->value = $value;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Executor/UnionInterfaceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ final class UnionInterfaceTest extends TestCase

public Person $john;

public function setUp(): void
protected function setUp(): void
{
$NamedType = new InterfaceType([
'name' => 'Named',
Expand Down
2 changes: 1 addition & 1 deletion tests/Executor/VariablesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ private function executeQuery(string $query, ?array $variableValues = null): Exe
}

/** @throws InvariantViolation */
public function schema(): Schema
private function schema(): Schema
{
$ComplexScalarType = new ComplexScalar();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@

final class IsAbstractTypeStaticMethodTypeSpecifyingExtension implements StaticMethodTypeSpecifyingExtension, TypeSpecifierAwareExtension
{
/** @var TypeSpecifier */
private $typeSpecifier;
private TypeSpecifier $typeSpecifier;

public function getClass(): string
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@

final class IsCompositeTypeStaticMethodTypeSpecifyingExtension implements StaticMethodTypeSpecifyingExtension, TypeSpecifierAwareExtension
{
/** @var TypeSpecifier */
private $typeSpecifier;
private TypeSpecifier $typeSpecifier;

public function getClass(): string
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@

final class IsInputTypeStaticMethodTypeSpecifyingExtension implements StaticMethodTypeSpecifyingExtension, TypeSpecifierAwareExtension
{
/** @var TypeSpecifier */
private $typeSpecifier;
private TypeSpecifier $typeSpecifier;

public function getClass(): string
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@

final class IsOutputTypeStaticMethodTypeSpecifyingExtension implements StaticMethodTypeSpecifyingExtension, TypeSpecifierAwareExtension
{
/** @var TypeSpecifier */
private $typeSpecifier;
private TypeSpecifier $typeSpecifier;

public function getClass(): string
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Server/QueryExecutionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ final class QueryExecutionTest extends ServerTestCase

private ServerConfig $config;

public function setUp(): void
protected function setUp(): void
{
$schema = $this->buildSchema();
$this->config = ServerConfig::create()
Expand Down
2 changes: 1 addition & 1 deletion tests/Server/StandardServerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ final class StandardServerTest extends ServerTestCase
/** @var ServerConfig */
private $config;

public function setUp(): void
protected function setUp(): void
{
$schema = $this->buildSchema();
$this->config = ServerConfig::create()
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCaseBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ abstract class TestCaseBase extends TestCase
*
* @see TestCase::expectNotToPerformAssertions()
*/
public function assertDidNotCrash(): void
protected function assertDidNotCrash(): void
{
$this->addToAssertionCount(1);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Type/DefinitionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ final class DefinitionTest extends TestCaseBase

public CustomScalarType $scalarType;

public function setUp(): void
protected function setUp(): void
{
$this->objectType = new ObjectType(['name' => 'Object', 'fields' => ['tmp' => Type::string()]]);
$this->interfaceType = new InterfaceType(['name' => 'Interface', 'fields' => ['irrelevant' => Type::int()]]);
Expand Down
2 changes: 1 addition & 1 deletion tests/Type/EagerTypeLoaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ final class EagerTypeLoaderTest extends TypeLoaderTestCaseBase

private InputObjectType $postStoryMutationInput;

public function setUp(): void
protected function setUp(): void
{
parent::setUp();

Expand Down
2 changes: 1 addition & 1 deletion tests/Type/EnumTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ final class EnumTypeTest extends TestCase
/** @var \ArrayObject<string, int> */
private \ArrayObject $Complex2;

public function setUp(): void
protected function setUp(): void
{
$ColorType = new EnumType([
'name' => 'Color',
Expand Down
2 changes: 1 addition & 1 deletion tests/Type/LazyTypeLoaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ final class LazyTypeLoaderTest extends TypeLoaderTestCaseBase
/** @var array<string, Type> */
private array $loadedTypes = [];

public function setUp(): void
protected function setUp(): void
{
parent::setUp();

Expand Down
2 changes: 1 addition & 1 deletion tests/Type/SchemaTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ final class SchemaTest extends TestCase

private Schema $schema;

public function setUp(): void
protected function setUp(): void
{
$this->interfaceType = new InterfaceType([
'name' => 'Interface',
Expand Down
5 changes: 2 additions & 3 deletions tests/Type/TestClasses/MyCustomType.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@ final class MyCustomType extends ObjectType
{
public function __construct()
{
$config = [
parent::__construct([
'fields' => [
'a' => Type::string(),
],
];
parent::__construct($config);
]);
}
}
6 changes: 2 additions & 4 deletions tests/Type/TestClasses/ObjectIdStub.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@

final class ObjectIdStub
{
/** @var int */
private $id;
private int $id;

/** @param int $id */
public function __construct($id)
public function __construct(int $id)
{
$this->id = $id;
}
Expand Down
9 changes: 3 additions & 6 deletions tests/Type/TestClasses/OtherCustom.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,15 @@
use GraphQL\Type\Definition\ObjectType;
use GraphQL\Type\Definition\Type;

/**
* Note: named OtherCustom vs OtherCustomType intentionally.
*/
/** Named OtherCustom vs. OtherCustomType intentionally. */
final class OtherCustom extends ObjectType
{
public function __construct()
{
$config = [
parent::__construct([
'fields' => [
'b' => Type::string(),
],
];
parent::__construct($config);
]);
}
}
2 changes: 1 addition & 1 deletion tests/Type/TypeLoaderTestCaseBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ abstract class TypeLoaderTestCaseBase extends TestCaseBase
/** @var array<int, string> */
protected array $calls;

public function setUp(): void
protected function setUp(): void
{
$this->calls = [];
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Type/ValidationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ final class ValidationTest extends TestCaseBase

public float $Number;

public function setUp(): void
protected function setUp(): void
{
$this->Number = 1;

Expand Down
2 changes: 1 addition & 1 deletion tests/Utils/BreakingChangesFinderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ final class BreakingChangesFinderTest extends TestCase
{
private ObjectType $queryType;

public function setUp(): void
protected function setUp(): void
{
$this->queryType = new ObjectType([
'name' => 'Query',
Expand Down
2 changes: 1 addition & 1 deletion tests/Utils/CoerceInputValueTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ final class CoerceInputValueTest extends TestCase
/** @var ListOfType<ListOfType<ScalarType>> */
private ListOfType $testNestedList;

public function setUp(): void
protected function setUp(): void
{
$this->testNonNull = Type::nonNull(Type::int());

Expand Down
2 changes: 1 addition & 1 deletion tests/Utils/ExtractTypesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ final class ExtractTypesTest extends TestCase
/** @var InputObjectType */
private $postCommentMutationInput;

public function setUp(): void
protected function setUp(): void
{
$this->node = new InterfaceType([
'name' => 'Node',
Expand Down
Loading
Loading