Skip to content

Commit 67c43b4

Browse files
committed
Update PHP CS Fixer and cleanup code
1 parent 6dfd584 commit 67c43b4

36 files changed

+78
-25
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
"static-analysis": [
9292
"phpstan analyse --ansi --memory-limit=1G"
9393
],
94-
"install-cs": "test -f php-cs-fixer.phar || wget https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/v3.11.0/php-cs-fixer.phar -O php-cs-fixer.phar",
94+
"install-cs": "test -f php-cs-fixer.phar || wget https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/v3.17.0/php-cs-fixer.phar -O php-cs-fixer.phar",
9595
"fix-cs": [
9696
"@install-cs",
9797
"@php php-cs-fixer.phar fix --diff -v --allow-risky=yes --ansi"

src/Definition/Builder/SchemaBuilder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function __construct(TypeResolver $typeResolver, bool $enableValidation =
2323
$this->enableValidation = $enableValidation;
2424
}
2525

26-
public function getBuilder(string $name, ?string $queryAlias, ?string $mutationAlias = null, ?string $subscriptionAlias = null, array $types = []): Closure
26+
public function getBuilder(string $name, ?string $queryAlias, string $mutationAlias = null, string $subscriptionAlias = null, array $types = []): Closure
2727
{
2828
return function () use ($name, $queryAlias, $mutationAlias, $subscriptionAlias, $types): ExtensibleSchema {
2929
static $schema = null;
@@ -38,7 +38,7 @@ public function getBuilder(string $name, ?string $queryAlias, ?string $mutationA
3838
/**
3939
* @param string[] $types
4040
*/
41-
public function create(string $name, ?string $queryAlias, ?string $mutationAlias = null, ?string $subscriptionAlias = null, array $types = []): ExtensibleSchema
41+
public function create(string $name, ?string $queryAlias, string $mutationAlias = null, string $subscriptionAlias = null, array $types = []): ExtensibleSchema
4242
{
4343
$this->typeResolver->setCurrentSchemaName($name);
4444
$query = $this->typeResolver->resolve($queryAlias);

src/Definition/Type/PhpEnumType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public function parseValue($value): mixed
9393
return parent::parseValue($value);
9494
}
9595

96-
public function parseLiteral(Node $valueNode, ?array $variables = null): mixed
96+
public function parseLiteral(Node $valueNode, array $variables = null): mixed
9797
{
9898
if ($this->enumClass) {
9999
if (!$valueNode instanceof EnumValueNode) {

src/Executor/Executor.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ public function execute(
2828
$contextValue = null,
2929
$variableValues = null,
3030
$operationName = null,
31-
?callable $fieldResolver = null,
32-
?array $validationRules = null
31+
callable $fieldResolver = null,
32+
array $validationRules = null
3333
): ExecutionResult {
3434
if (!method_exists($promiseAdapter, 'wait')) {
3535
throw new RuntimeException(

src/Executor/ExecutorInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function execute(
2525
$contextValue = null,
2626
$variableValues = null,
2727
$operationName = null,
28-
?callable $fieldResolver = null,
29-
?array $validationRules = null
28+
callable $fieldResolver = null,
29+
array $validationRules = null
3030
): ExecutionResult;
3131
}

src/ExpressionLanguage/ExpressionFunction.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class ExpressionFunction extends BaseExpressionFunction
1212
{
1313
protected string $gqlServices = '$'.TypeGenerator::GRAPHQL_SERVICES;
1414

15-
public function __construct(string $name, callable $compiler, ?callable $evaluator = null)
15+
public function __construct(string $name, callable $compiler, callable $evaluator = null)
1616
{
1717
if (null === $evaluator) {
1818
$evaluator = new EvaluatorIsNotAllowedException($name);

src/Generator/TypeBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ private function buildScalarCallback($callback, string $fieldName)
449449
*
450450
* @throws GeneratorException
451451
*/
452-
private function buildResolve($resolve, ?array $groups = null): GeneratorInterface
452+
private function buildResolve($resolve, array $groups = null): GeneratorInterface
453453
{
454454
if (is_callable($resolve) && is_array($resolve)) {
455455
return Collection::numeric($resolve);

src/Generator/TypeGeneratorOptions.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ public function __construct(
3636
string $namespace,
3737
?string $cacheDir,
3838
bool $useClassMap = true,
39-
?string $cacheBaseDir = null,
40-
?int $cacheDirMask = null
39+
string $cacheBaseDir = null,
40+
int $cacheDirMask = null
4141
) {
4242
$this->namespace = $namespace;
4343
$this->cacheDir = $cacheDir;

src/Relay/Connection/ConnectionBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ final class ConnectionBuilder
5959
* @phpstan-param ConnectionFactoryFunc|null $connectionCallback
6060
* @phpstan-param EdgeFactoryFunc|null $edgeCallback
6161
*/
62-
public function __construct(?CursorEncoderInterface $cursorEncoder = null, ?callable $connectionCallback = null, ?callable $edgeCallback = null)
62+
public function __construct(CursorEncoderInterface $cursorEncoder = null, callable $connectionCallback = null, callable $edgeCallback = null)
6363
{
6464
$this->cursorEncoder = $cursorEncoder ?? new Base64CursorEncoder();
6565
$this->connectionCallback = $connectionCallback ?? static fn (array $edges, PageInfoInterface $pageInfo): Connection => new Connection($edges, $pageInfo);

src/Relay/Connection/Output/Connection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class Connection implements ConnectionInterface
2626
protected ?PageInfoInterface $pageInfo;
2727

2828
/** @var int|Promise|null Total count or promise that returns the total count */
29-
protected $totalCount = null;
29+
protected $totalCount;
3030

3131
/**
3232
* @param EdgeInterface<T>[] $edges

0 commit comments

Comments
 (0)