Skip to content

Commit 31f217f

Browse files
authored
Merge pull request #1198 from benji07/fix-php84-nullable-deprecation
PHP 8.4 deprecates implicitly nullable types
2 parents a8c5661 + c7b4c24 commit 31f217f

File tree

59 files changed

+88
-84
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+88
-84
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ jobs:
2020
- '8.1'
2121
- '8.2'
2222
- '8.3'
23+
- '8.4'
2324
symfony-version:
2425
- '5.4.*'
2526
- '6.0.*'
@@ -45,6 +46,8 @@ jobs:
4546
symfony-version: '7.0.*'
4647
- php-version: '8.1'
4748
symfony-version: '7.1.*'
49+
- php-version: '8.4'
50+
dependencies: 'lowest'
4851
include:
4952
- php-version: '8.0'
5053
symfony-version: '5.4.*'

.php-cs-fixer.dist.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
'single_line_comment_style' => false,
3636
'phpdoc_no_alias_tag' => ['replacements' => ['type' => 'var']],
3737
'no_mixed_echo_print' => ['use' => 'echo'],
38+
'nullable_type_declaration_for_default_null_value' => true,
3839
]
3940
)
4041
->setFinder($finder)

src/Annotation/Builder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ abstract class Builder extends Annotation
2020
/**
2121
* Builder name.
2222
*/
23-
public string $name;
23+
public ?string $name;
2424

2525
/**
2626
* The builder config.
@@ -31,7 +31,7 @@ abstract class Builder extends Annotation
3131
* @param string|null $name The name of the builder
3232
* @param array $config The builder configuration array
3333
*/
34-
public function __construct(string $name = null, array $config = [])
34+
public function __construct(?string $name = null, array $config = [])
3535
{
3636
$this->name = $name;
3737
$this->config = $config;

src/Annotation/Input.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ final class Input extends Annotation
2727
*/
2828
public bool $isRelay = false;
2929

30-
public function __construct(string $name = null, bool $isRelay = false)
30+
public function __construct(?string $name = null, bool $isRelay = false)
3131
{
3232
$this->name = $name;
3333
$this->isRelay = $isRelay;

src/Annotation/Provider.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ final class Provider extends Annotation
3737
public ?array $targetMutationTypes;
3838

3939
/**
40-
* @param string $prefix A prefix to apply to the name of fields generated by this provider
40+
* @param string|null $prefix A prefix to apply to the name of fields generated by this provider
4141
* @param string|string[]|null $targetQueryTypes A list of GraphQL types to add the resolver queries to
4242
* @param string|string[]|null $targetMutationTypes A list of GraphQL types to add the resolver mutations to
4343
*/
44-
public function __construct(string $prefix = null, $targetQueryTypes = null, $targetMutationTypes = null)
44+
public function __construct(?string $prefix = null, $targetQueryTypes = null, $targetMutationTypes = null)
4545
{
4646
$this->prefix = $prefix;
4747
$this->targetQueryTypes = is_string($targetQueryTypes) ? [$targetQueryTypes] : $targetQueryTypes;

src/Annotation/Relay/Connection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ final class Connection extends Type
2929
*/
3030
public ?string $node;
3131

32-
public function __construct(string $edge = null, string $node = null)
32+
public function __construct(?string $edge = null, ?string $node = null)
3333
{
3434
$this->edge = $edge;
3535
$this->node = $node;

src/Annotation/Scalar.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ final class Scalar extends Annotation
2525
* @param string|null $name The GraphQL name of the Scalar
2626
* @param string|null $scalarType Expression to reuse an other scalar type
2727
*/
28-
public function __construct(string $name = null, string $scalarType = null)
28+
public function __construct(?string $name = null, ?string $scalarType = null)
2929
{
3030
$this->name = $name;
3131
$this->scalarType = $scalarType;

src/Annotation/Type.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@ class Type extends Annotation
5252
* @param string|null $isTypeOf An expression to resolve if the field is of given type
5353
*/
5454
public function __construct(
55-
string $name = null,
55+
?string $name = null,
5656
array $interfaces = [],
5757
bool $isRelay = false,
58-
string $resolveField = null,
59-
string $isTypeOf = null
58+
?string $resolveField = null,
59+
?string $isTypeOf = null
6060
) {
6161
$this->name = $name;
6262
$this->interfaces = $interfaces;

src/Annotation/TypeInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ final class TypeInterface extends Annotation
2828
public ?string $name;
2929

3030
/**
31-
* @param string $resolveType The express resolve type
31+
* @param string|null $resolveType The express resolve type
3232
* @param string|null $name The GraphQL name of the interface
3333
*/
3434
public function __construct(?string $resolveType = null, ?string $name = null)

src/Annotation/Union.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ final class Union extends Annotation
3737
* @param string[] $types List of types included in the union
3838
* @param string|null $resolveType The resolve type expression
3939
*/
40-
public function __construct(string $name = null, array $types = [], ?string $resolveType = null)
40+
public function __construct(?string $name = null, array $types = [], ?string $resolveType = null)
4141
{
4242
$this->name = $name;
4343
$this->types = $types;

0 commit comments

Comments
 (0)