Skip to content

Commit 4a3a72e

Browse files
committed
Migrate to PHP 7.4 syntax with Rector
1 parent 273b28b commit 4a3a72e

32 files changed

+85
-201
lines changed

src/Annotation/AbstractAnnotation.php

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,39 +14,28 @@ abstract class AbstractAnnotation
1414
/**
1515
* The name of the argument, it must matches the actual PHP argument name.
1616
*
17-
* @var null|string
1817
* @Required
1918
*/
20-
private $name;
19+
private ?string $name = null;
2120

2221
/**
2322
* FQCN of PHP class implementing the GraphQL type.
24-
*
25-
* @var null|string
2623
*/
27-
private $type;
24+
private ?string $type = null;
2825

2926
/**
3027
* Instance of the GraphQL type.
31-
*
32-
* @var null|Type
3328
*/
34-
private $typeInstance;
29+
private ?Type $typeInstance = null;
3530

36-
/**
37-
* @var null|string
38-
*/
39-
private $description;
31+
private ?string $description = null;
4032

4133
/**
4234
* @var mixed
4335
*/
4436
private $defaultValue;
4537

46-
/**
47-
* @var bool
48-
*/
49-
private $hasDefaultValue = false;
38+
private bool $hasDefaultValue = false;
5039

5140
public function __construct(array $values = [])
5241
{

src/Definition/EntityID.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,7 @@
1414
*/
1515
class EntityID
1616
{
17-
/**
18-
* @var EntityManager
19-
*/
20-
private $entityManager;
17+
private EntityManager $entityManager;
2118

2219
/**
2320
* The entity class name.
@@ -28,10 +25,8 @@ class EntityID
2825

2926
/**
3027
* The entity id.
31-
*
32-
* @var null|string
3328
*/
34-
private $id;
29+
private ?string $id;
3530

3631
/**
3732
* @param class-string<T> $className

src/Definition/EntityIDType.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use GraphQL\Doctrine\Utils;
99
use GraphQL\Error\Error;
1010
use GraphQL\Language\AST\IntValueNode;
11+
use GraphQL\Language\AST\Node;
1112
use GraphQL\Language\AST\StringValueNode;
1213
use GraphQL\Type\Definition\ScalarType;
1314

@@ -16,10 +17,7 @@
1617
*/
1718
final class EntityIDType extends ScalarType
1819
{
19-
/**
20-
* @var EntityManager
21-
*/
22-
private $entityManager;
20+
private EntityManager $entityManager;
2321

2422
/**
2523
* The entity class name.
@@ -71,7 +69,7 @@ public function parseValue($value, ?array $variables = null): EntityID
7169
/**
7270
* Parses an externally provided literal value (hardcoded in GraphQL query) to use as an input.
7371
*
74-
* @param \GraphQL\Language\AST\Node $valueNode
72+
* @param Node $valueNode
7573
*/
7674
public function parseLiteral($valueNode, ?array $variables = null): EntityID
7775
{

src/DocBlockReader.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,7 @@
1212
*/
1313
final class DocBlockReader
1414
{
15-
/**
16-
* @var string
17-
*/
18-
private $comment;
15+
private string $comment;
1916

2017
public function __construct(ReflectionMethod $method)
2118
{

src/Factory/AbstractFieldsConfigurationFactory.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,13 @@ abstract class AbstractFieldsConfigurationFactory extends AbstractFactory
2626
{
2727
/**
2828
* Doctrine metadata for the entity.
29-
*
30-
* @var ClassMetadata
3129
*/
32-
private $metadata;
30+
private ClassMetadata $metadata;
3331

3432
/**
3533
* The identity field name, eg: "id".
36-
*
37-
* @var string
3834
*/
39-
private $identityField;
35+
private string $identityField;
4036

4137
/**
4238
* Returns the regexp pattern to filter method names.

src/Factory/FilteredQueryBuilderFactory.php

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,30 +19,21 @@
1919
*/
2020
final class FilteredQueryBuilderFactory extends AbstractFactory
2121
{
22-
/**
23-
* @var UniqueNameFactory
24-
*/
25-
private $uniqueNameFactory;
22+
private UniqueNameFactory $uniqueNameFactory;
2623

27-
/**
28-
* @var SortingTypeFactory
29-
*/
30-
private $sortingTypeFactory;
24+
private SortingTypeFactory $sortingTypeFactory;
3125

32-
/**
33-
* @var QueryBuilder
34-
*/
35-
private $queryBuilder;
26+
private QueryBuilder $queryBuilder;
3627

3728
/**
3829
* @var string[]
3930
*/
40-
private $dqlConditions = [];
31+
private array $dqlConditions = [];
4132

4233
/**
4334
* @var string[]
4435
*/
45-
private $uniqueJoins = [];
36+
private array $uniqueJoins = [];
4637

4738
public function __construct(Types $types, EntityManager $entityManager, SortingTypeFactory $sortingTypeFactory)
4839
{

src/Factory/MetadataReader/MappingDriverChainAdapter.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,7 @@
1414

1515
final class MappingDriverChainAdapter implements Reader
1616
{
17-
/**
18-
* @var MappingDriverChain
19-
*/
20-
private $chainDriver;
17+
private MappingDriverChain $chainDriver;
2118

2219
public function __construct(MappingDriverChain $chainDriver)
2320
{

src/Factory/Type/FilterGroupConditionTypeFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ final class FilterGroupConditionTypeFactory extends AbstractTypeFactory
3737
/**
3838
* @var Filter[][]
3939
*/
40-
private $customOperators;
40+
private array $customOperators;
4141

4242
/**
4343
* Create an InputObjectType from a Doctrine entity to

src/Factory/Type/FilterTypeFactory.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,9 @@
1515
*/
1616
final class FilterTypeFactory extends AbstractTypeFactory
1717
{
18-
/**
19-
* @var FilterGroupJoinTypeFactory
20-
*/
21-
private $filterGroupJoinTypeFactory;
18+
private FilterGroupJoinTypeFactory $filterGroupJoinTypeFactory;
2219

23-
/**
24-
* @var FilterGroupConditionTypeFactory
25-
*/
26-
private $filterGroupConditionTypeFactory;
20+
private FilterGroupConditionTypeFactory $filterGroupConditionTypeFactory;
2721

2822
public function __construct(Types $types, EntityManager $entityManager, FilterGroupJoinTypeFactory $filterGroupJoinTypeFactory, FilterGroupConditionTypeFactory $filterGroupConditionTypeFactory)
2923
{

src/Factory/Type/JoinOnTypeFactory.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,9 @@
1515
*/
1616
final class JoinOnTypeFactory extends AbstractTypeFactory
1717
{
18-
/**
19-
* @var FilterGroupJoinTypeFactory
20-
*/
21-
private $filterGroupJoinTypeFactory;
18+
private FilterGroupJoinTypeFactory $filterGroupJoinTypeFactory;
2219

23-
/**
24-
* @var FilterGroupConditionTypeFactory
25-
*/
26-
private $filterGroupConditionTypeFactory;
20+
private FilterGroupConditionTypeFactory $filterGroupConditionTypeFactory;
2721

2822
public function __construct(Types $types, EntityManager $entityManager, FilterGroupJoinTypeFactory $filterGroupJoinTypeFactory, FilterGroupConditionTypeFactory $filterGroupConditionTypeFactory)
2923
{

0 commit comments

Comments
 (0)