@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | $fields = []; |
| 42 | 42 | $targetEntity = $this->typeManager->build(Entity::class, $id); |
| 43 | 43 | |
| 44 | - if (! count($requiredFields) && ! count($optionalFields)) { |
|
| 44 | + if (!count($requiredFields) && !count($optionalFields)) { |
|
| 45 | 45 | $this->addAllFieldsAsRequired($targetEntity, $fields); |
| 46 | 46 | } else { |
| 47 | 47 | $this->addRequiredFields($targetEntity, $requiredFields, $fields); |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | array &$fields, |
| 66 | 66 | ): void { |
| 67 | 67 | foreach ($this->entityManager->getClassMetadata($targetEntity->getEntityClass())->getFieldNames() as $fieldName) { |
| 68 | - if (! in_array($fieldName, $optionalFields) && $optionalFields !== ['*']) { |
|
| 68 | + if (!in_array($fieldName, $optionalFields) && $optionalFields !== ['*']) { |
|
| 69 | 69 | continue; |
| 70 | 70 | } |
| 71 | 71 | |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | array &$fields, |
| 97 | 97 | ): void { |
| 98 | 98 | foreach ($this->entityManager->getClassMetadata($targetEntity->getEntityClass())->getFieldNames() as $fieldName) { |
| 99 | - if (! in_array($fieldName, $requiredFields) && $requiredFields !== ['*']) { |
|
| 99 | + if (!in_array($fieldName, $requiredFields) && $requiredFields !== ['*']) { |
|
| 100 | 100 | continue; |
| 101 | 101 | } |
| 102 | 102 | |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | $this->hydratorFactory = $container->get(HydratorFactory::class); |
| 58 | 58 | $this->typeManager = $container->get(TypeManager::class); |
| 59 | 59 | |
| 60 | - if (! isset($container->get('metadata')[$typeName])) { |
|
| 60 | + if (!isset($container->get('metadata')[$typeName])) { |
|
| 61 | 61 | throw new Error( |
| 62 | 62 | 'Entity ' . $typeName . ' is not mapped in the metadata', |
| 63 | 63 | ); |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | return $this->metadata['typeName']; |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | - public function getDescription(): string|null |
|
| 84 | + public function getDescription(): string | null |
|
| 85 | 85 | { |
| 86 | 86 | return $this->metadata['description']; |
| 87 | 87 | } |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | $classMetadata = $this->entityManager->getClassMetadata($this->getEntityClass()); |
| 141 | 141 | |
| 142 | 142 | foreach ($classMetadata->getFieldNames() as $fieldName) { |
| 143 | - if (! in_array($fieldName, array_keys($this->metadata['fields']))) { |
|
| 143 | + if (!in_array($fieldName, array_keys($this->metadata['fields']))) { |
|
| 144 | 144 | continue; |
| 145 | 145 | } |
| 146 | 146 | |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | $classMetadata = $this->entityManager->getClassMetadata($this->getEntityClass()); |
| 159 | 159 | |
| 160 | 160 | foreach ($classMetadata->getAssociationNames() as $associationName) { |
| 161 | - if (! in_array($associationName, array_keys($this->metadata['fields']))) { |
|
| 161 | + if (!in_array($associationName, array_keys($this->metadata['fields']))) { |
|
| 162 | 162 | continue; |
| 163 | 163 | } |
| 164 | 164 | |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | case ClassMetadataInfo::MANY_TO_ONE: |
| 170 | 170 | case ClassMetadataInfo::TO_ONE: |
| 171 | 171 | $targetEntity = $associationMetadata['targetEntity']; |
| 172 | - $fields[$associationName] = function () use ($targetEntity) { |
|
| 172 | + $fields[$associationName] = function() use ($targetEntity) { |
|
| 173 | 173 | $entity = $this->typeManager->build(self::class, $targetEntity); |
| 174 | 174 | |
| 175 | 175 | return [ |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | case ClassMetadataInfo::MANY_TO_MANY: |
| 183 | 183 | case ClassMetadataInfo::TO_MANY: |
| 184 | 184 | $targetEntity = $associationMetadata['targetEntity']; |
| 185 | - $fields[$associationName] = function () use ($targetEntity, $associationName) { |
|
| 185 | + $fields[$associationName] = function() use ($targetEntity, $associationName) { |
|
| 186 | 186 | $entity = $this->typeManager->build(self::class, $targetEntity); |
| 187 | 187 | $shortName = $this->getTypeName() . '_' . $associationName; |
| 188 | 188 | |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | |
| 83 | 83 | // Only one matching instance per group is allowed |
| 84 | 84 | assert( |
| 85 | - ! $entityInstance, |
|
| 85 | + !$entityInstance, |
|
| 86 | 86 | 'Duplicate attribute found for entity ' |
| 87 | 87 | . $reflectionClass->getName() . ', group ' . $instance->getGroup(), |
| 88 | 88 | ); |
@@ -99,8 +99,7 @@ discard block |
||
| 99 | 99 | 'excludeCriteria' => $instance->getExcludeCriteria(), |
| 100 | 100 | 'description' => $instance->getDescription(), |
| 101 | 101 | 'typeName' => $instance->getTypeName() |
| 102 | - ? $this->appendGroupSuffix($instance->getTypeName()) : |
|
| 103 | - $this->getTypeName($reflectionClass->getName()), |
|
| 102 | + ? $this->appendGroupSuffix($instance->getTypeName()) : $this->getTypeName($reflectionClass->getName()), |
|
| 104 | 103 | ]; |
| 105 | 104 | } |
| 106 | 105 | } |
@@ -123,7 +122,7 @@ discard block |
||
| 123 | 122 | |
| 124 | 123 | // Only one matching instance per group is allowed |
| 125 | 124 | assert( |
| 126 | - ! $fieldInstance, |
|
| 125 | + !$fieldInstance, |
|
| 127 | 126 | 'Duplicate attribute found for field ' |
| 128 | 127 | . $fieldName . ', group ' . $instance->getGroup(), |
| 129 | 128 | ); |
@@ -174,7 +173,7 @@ discard block |
||
| 174 | 173 | |
| 175 | 174 | // Only one matching instance per group is allowed |
| 176 | 175 | assert( |
| 177 | - ! $associationInstance, |
|
| 176 | + !$associationInstance, |
|
| 178 | 177 | 'Duplicate attribute found for association ' |
| 179 | 178 | . $associationName . ', group ' . $instance->getGroup(), |
| 180 | 179 | ); |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | */ |
| 24 | 24 | public function __construct( |
| 25 | 25 | EntityManager $entityManager, |
| 26 | - Config|null $config = null, |
|
| 26 | + Config | null $config = null, |
|
| 27 | 27 | array $metadata = [], |
| 28 | 28 | ) { |
| 29 | 29 | $metadata = new ArrayObject($metadata); |
@@ -33,8 +33,8 @@ discard block |
||
| 33 | 33 | ->set(EntityManager::class, $entityManager) |
| 34 | 34 | ->set( |
| 35 | 35 | Config::class, |
| 36 | - static function () use ($config) { |
|
| 37 | - if (! $config) { |
|
| 36 | + static function() use ($config) { |
|
| 37 | + if (!$config) { |
|
| 38 | 38 | $config = new Config(); |
| 39 | 39 | } |
| 40 | 40 | |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | ) |
| 52 | 52 | ->set( |
| 53 | 53 | 'metadata', |
| 54 | - static function (AbstractContainer $container) use ($metadata) { |
|
| 54 | + static function(AbstractContainer $container) use ($metadata) { |
|
| 55 | 55 | return (new Metadata\MetadataFactory( |
| 56 | 56 | $metadata, |
| 57 | 57 | $container->get(EntityManager::class), |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | ) |
| 64 | 64 | ->set( |
| 65 | 65 | Metadata\GlobalEnable::class, |
| 66 | - static function (AbstractContainer $container) { |
|
| 66 | + static function(AbstractContainer $container) { |
|
| 67 | 67 | return new Metadata\GlobalEnable( |
| 68 | 68 | $container->get(EntityManager::class), |
| 69 | 69 | $container->get(Config::class), |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | ) |
| 74 | 74 | ->set( |
| 75 | 75 | Resolve\FieldResolver::class, |
| 76 | - static function (AbstractContainer $container) { |
|
| 76 | + static function(AbstractContainer $container) { |
|
| 77 | 77 | return new Resolve\FieldResolver( |
| 78 | 78 | $container->get(Config::class), |
| 79 | 79 | $container->get(Type\TypeManager::class), |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | ) |
| 83 | 83 | ->set( |
| 84 | 84 | Resolve\ResolveCollectionFactory::class, |
| 85 | - static function (AbstractContainer $container) { |
|
| 85 | + static function(AbstractContainer $container) { |
|
| 86 | 86 | return new Resolve\ResolveCollectionFactory( |
| 87 | 87 | $container->get(EntityManager::class), |
| 88 | 88 | $container->get(Config::class), |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | ) |
| 96 | 96 | ->set( |
| 97 | 97 | Resolve\ResolveEntityFactory::class, |
| 98 | - static function (AbstractContainer $container) { |
|
| 98 | + static function(AbstractContainer $container) { |
|
| 99 | 99 | return new Resolve\ResolveEntityFactory( |
| 100 | 100 | $container->get(Config::class), |
| 101 | 101 | $container->get(EntityManager::class), |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | ) |
| 107 | 107 | ->set( |
| 108 | 108 | Criteria\CriteriaFactory::class, |
| 109 | - static function (AbstractContainer $container) { |
|
| 109 | + static function(AbstractContainer $container) { |
|
| 110 | 110 | return new Criteria\CriteriaFactory( |
| 111 | 111 | $container->get(Config::class), |
| 112 | 112 | $container->get(EntityManager::class), |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | ) |
| 118 | 118 | ->set( |
| 119 | 119 | Hydrator\HydratorFactory::class, |
| 120 | - static function (AbstractContainer $container) { |
|
| 120 | + static function(AbstractContainer $container) { |
|
| 121 | 121 | return new Hydrator\HydratorFactory( |
| 122 | 122 | $container->get(EntityManager::class), |
| 123 | 123 | $container->get(Type\TypeManager::class), |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | ) |
| 127 | 127 | ->set( |
| 128 | 128 | Input\InputFactory::class, |
| 129 | - static function (AbstractContainer $container) { |
|
| 129 | + static function(AbstractContainer $container) { |
|
| 130 | 130 | return new Input\InputFactory( |
| 131 | 131 | $container->get(Config::class), |
| 132 | 132 | $container->get(EntityManager::class), |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | private int $limit; |
| 26 | 26 | |
| 27 | 27 | /** @var string|null Documentation for the entity within GraphQL */ |
| 28 | - private string|null $description = null; |
|
| 28 | + private string | null $description = null; |
|
| 29 | 29 | |
| 30 | 30 | /** |
| 31 | 31 | * @var mixed[] An array of filters as |
@@ -45,10 +45,10 @@ discard block |
||
| 45 | 45 | string $group = 'default', |
| 46 | 46 | bool $byValue = true, |
| 47 | 47 | int $limit = 0, |
| 48 | - string|null $description = null, |
|
| 49 | - private string|null $typeName = null, |
|
| 48 | + string | null $description = null, |
|
| 49 | + private string | null $typeName = null, |
|
| 50 | 50 | array $filters = [], |
| 51 | - private string|null $namingStrategy = null, |
|
| 51 | + private string | null $namingStrategy = null, |
|
| 52 | 52 | private array $excludeCriteria = [], |
| 53 | 53 | private array $includeCriteria = [], |
| 54 | 54 | ) { |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | $this->filters = $filters; |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | - public function getGroup(): string|null |
|
| 62 | + public function getGroup(): string | null |
|
| 63 | 63 | { |
| 64 | 64 | return $this->group; |
| 65 | 65 | } |
@@ -74,12 +74,12 @@ discard block |
||
| 74 | 74 | return $this->limit; |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | - public function getDescription(): string|null |
|
| 77 | + public function getDescription(): string | null |
|
| 78 | 78 | { |
| 79 | 79 | return $this->description; |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | - public function getTypeName(): string|null |
|
| 82 | + public function getTypeName(): string | null |
|
| 83 | 83 | { |
| 84 | 84 | return $this->typeName; |
| 85 | 85 | } |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | return $this->filters; |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | - public function getNamingStrategy(): string|null |
|
| 93 | + public function getNamingStrategy(): string | null |
|
| 94 | 94 | { |
| 95 | 95 | return $this->namingStrategy; |
| 96 | 96 | } |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | |
| 34 | 34 | public function get(Entity $entity, string $eventName): Closure |
| 35 | 35 | { |
| 36 | - return function ($objectValue, array $args, $context, ResolveInfo $info) use ($entity, $eventName) { |
|
| 36 | + return function($objectValue, array $args, $context, ResolveInfo $info) use ($entity, $eventName) { |
|
| 37 | 37 | $entityClass = $entity->getEntityClass(); |
| 38 | 38 | |
| 39 | 39 | $queryBuilderFilter = (new Applicator($this->entityManager, $entityClass)) |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | $itemCount = $paginator->count(); |
| 191 | 191 | |
| 192 | 192 | // Rebuild paginator if needed |
| 193 | - if ($paginationFields['last'] && ! $paginationFields['before']) { |
|
| 193 | + if ($paginationFields['last'] && !$paginationFields['before']) { |
|
| 194 | 194 | $offsetAndLimit['offset'] = $itemCount - $paginationFields['last']; |
| 195 | 195 | $queryBuilder->setFirstResult($offsetAndLimit['offset']); |
| 196 | 196 | $paginator = new Paginator($queryBuilder->getQuery()); |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | 'cursor' => $cursors['last'], |
| 205 | 205 | ]; |
| 206 | 206 | |
| 207 | - if (! $cursors['first']) { |
|
| 207 | + if (!$cursors['first']) { |
|
| 208 | 208 | $cursors['first'] = $cursors['last']; |
| 209 | 209 | } |
| 210 | 210 | |
@@ -232,7 +232,7 @@ discard block |
||
| 232 | 232 | |
| 233 | 233 | $limit = $this->metadata[$entity->getEntityClass()]['limit']; |
| 234 | 234 | |
| 235 | - if (! $limit) { |
|
| 235 | + if (!$limit) { |
|
| 236 | 236 | $limit = $this->config->getLimit(); |
| 237 | 237 | } |
| 238 | 238 | |
@@ -17,16 +17,16 @@ discard block |
||
| 17 | 17 | */ |
| 18 | 18 | public function __construct( |
| 19 | 19 | protected string $group = 'default', |
| 20 | - protected string|null $strategy = null, |
|
| 21 | - protected string|null $description = null, |
|
| 20 | + protected string | null $strategy = null, |
|
| 21 | + protected string | null $description = null, |
|
| 22 | 22 | protected array $excludeCriteria = [], |
| 23 | 23 | protected array $includeCriteria = [], |
| 24 | - protected string|null $filterCriteriaEventName = null, |
|
| 25 | - protected int|null $limit = null, |
|
| 24 | + protected string | null $filterCriteriaEventName = null, |
|
| 25 | + protected int | null $limit = null, |
|
| 26 | 26 | ) { |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | - public function getLimit(): int|null |
|
| 29 | + public function getLimit(): int | null |
|
| 30 | 30 | { |
| 31 | 31 | return $this->limit; |
| 32 | 32 | } |
@@ -36,17 +36,17 @@ discard block |
||
| 36 | 36 | return $this->group; |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | - public function getStrategy(): string|null |
|
| 39 | + public function getStrategy(): string | null |
|
| 40 | 40 | { |
| 41 | 41 | return $this->strategy; |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | - public function getDescription(): string|null |
|
| 44 | + public function getDescription(): string | null |
|
| 45 | 45 | { |
| 46 | 46 | return $this->description; |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | - public function getFilterCriteriaEventName(): string|null |
|
| 49 | + public function getFilterCriteriaEventName(): string | null |
|
| 50 | 50 | { |
| 51 | 51 | return $this->filterCriteriaEventName; |
| 52 | 52 | } |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | |
| 58 | 58 | public function get(Entity $entity): Closure |
| 59 | 59 | { |
| 60 | - return function ($source, array $args, $context, ResolveInfo $info) { |
|
| 60 | + return function($source, array $args, $context, ResolveInfo $info) { |
|
| 61 | 61 | $fieldResolver = $this->fieldResolver; |
| 62 | 62 | $collection = $fieldResolver($source, $args, $context, $info); |
| 63 | 63 | |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | } |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | - if (! empty($orderBy)) { |
|
| 122 | + if (!empty($orderBy)) { |
|
| 123 | 123 | $criteria->orderBy($orderBy); |
| 124 | 124 | } |
| 125 | 125 | |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | array $pagination, |
| 138 | 138 | PersistentCollection $collection, |
| 139 | 139 | Criteria $criteria, |
| 140 | - string|null $filterCriteriaEventName, |
|
| 140 | + string | null $filterCriteriaEventName, |
|
| 141 | 141 | mixed ...$resolve, |
| 142 | 142 | ): array { |
| 143 | 143 | $paginationFields = [ |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | 'cursor' => $cursors['last'], |
| 228 | 228 | ]; |
| 229 | 229 | |
| 230 | - if (! $cursors['first']) { |
|
| 230 | + if (!$cursors['first']) { |
|
| 231 | 231 | $cursors['first'] = $cursors['last']; |
| 232 | 232 | } |
| 233 | 233 | |
@@ -259,7 +259,7 @@ discard block |
||
| 259 | 259 | $limit = $associationLimit; |
| 260 | 260 | } |
| 261 | 261 | |
| 262 | - if (! $limit) { |
|
| 262 | + if (!$limit) { |
|
| 263 | 263 | $limit = $this->config->getLimit(); |
| 264 | 264 | } |
| 265 | 265 | |
@@ -280,7 +280,7 @@ discard block |
||
| 280 | 280 | $offset = 0; |
| 281 | 281 | } |
| 282 | 282 | |
| 283 | - if ($paginationFields['last'] && ! $paginationFields['before']) { |
|
| 283 | + if ($paginationFields['last'] && !$paginationFields['before']) { |
|
| 284 | 284 | $offset = $itemCount - $paginationFields['last']; |
| 285 | 285 | } |
| 286 | 286 | |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | class NullifyOwningAssociation extends AbstractCollectionStrategy implements |
| 34 | 34 | StrategyInterface |
| 35 | 35 | { |
| 36 | - public function extract(mixed $value, object|null $object = null): mixed |
|
| 36 | + public function extract(mixed $value, object | null $object = null): mixed |
|
| 37 | 37 | { |
| 38 | 38 | throw new Error('Query is barred by Nullify Owning Association'); |
| 39 | 39 | } |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | * |
| 44 | 44 | * @codeCoverageIgnore |
| 45 | 45 | */ |
| 46 | - public function hydrate(mixed $value, array|null $data): void |
|
| 46 | + public function hydrate(mixed $value, array | null $data): void |
|
| 47 | 47 | { |
| 48 | 48 | } |
| 49 | 49 | } |