@@ -63,7 +63,7 @@ |
||
| 63 | 63 | /** @var ObjectDefinition $object */ |
| 64 | 64 | $object = $child->getTypeDefinition(); |
| 65 | 65 | |
| 66 | - if (! $object->hasInterface($parent->getTypeDefinition()->getName())) { |
|
| 66 | + if (!$object->hasInterface($parent->getTypeDefinition()->getName())) { |
|
| 67 | 67 | $error = \vsprintf('%s in %s definition must be instance of %s', [ |
| 68 | 68 | $object, $child, |
| 69 | 69 | $parent->getTypeDefinition(), |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | */ |
| 88 | 88 | private function validateListDirectRedefinition(AllowsTypeIndication $child, AllowsTypeIndication $parent): void |
| 89 | 89 | { |
| 90 | - $isBrokenDirectRedefinition = $parent->isList() && ! $child->isList(); |
|
| 90 | + $isBrokenDirectRedefinition = $parent->isList() && !$child->isList(); |
|
| 91 | 91 | |
| 92 | 92 | if ($isBrokenDirectRedefinition) { |
| 93 | 93 | $error = \sprintf('The %s cannot be overridden by non-list, but %s given', $parent, $child); |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | */ |
| 116 | 116 | private function validateListInverseRedefinition(AllowsTypeIndication $child, AllowsTypeIndication $parent): void |
| 117 | 117 | { |
| 118 | - $isBrokenInverseRedefinition = ! $parent->isList() && $child->isList(); |
|
| 118 | + $isBrokenInverseRedefinition = !$parent->isList() && $child->isList(); |
|
| 119 | 119 | |
| 120 | 120 | if ($isBrokenInverseRedefinition) { |
| 121 | 121 | $error = \sprintf('The %s cannot be overridden by list, but %s given', $parent, $child); |
@@ -131,10 +131,10 @@ discard block |
||
| 131 | 131 | */ |
| 132 | 132 | private function validatePostconditionalInheritance(AllowsTypeIndication $child, AllowsTypeIndication $parent): void |
| 133 | 133 | { |
| 134 | - $invalidWrapperInheritance = $parent->isNonNull() && ! $child->isNonNull(); |
|
| 134 | + $invalidWrapperInheritance = $parent->isNonNull() && !$child->isNonNull(); |
|
| 135 | 135 | |
| 136 | 136 | $invalidListWrapperInheritance = $this->isSameWrapperList($child, $parent) && |
| 137 | - $parent->isListOfNonNulls() && ! $child->isListOfNonNulls(); |
|
| 137 | + $parent->isListOfNonNulls() && !$child->isListOfNonNulls(); |
|
| 138 | 138 | |
| 139 | 139 | if ($invalidWrapperInheritance || $invalidListWrapperInheritance) { |
| 140 | 140 | $error = '%s postcondition of %s can not be weakened by %s of %s'; |
@@ -152,10 +152,10 @@ discard block |
||
| 152 | 152 | */ |
| 153 | 153 | private function validatePreconditionalInheritance(AllowsTypeIndication $child, AllowsTypeIndication $parent): void |
| 154 | 154 | { |
| 155 | - $invalidWrapperInheritance = ! $parent->isNonNull() && $child->isNonNull(); |
|
| 155 | + $invalidWrapperInheritance = !$parent->isNonNull() && $child->isNonNull(); |
|
| 156 | 156 | |
| 157 | 157 | $invalidListWrapperInheritance = $this->isSameWrapperList($child, $parent) && |
| 158 | - ! $parent->isListOfNonNulls() && $child->isListOfNonNulls(); |
|
| 158 | + !$parent->isListOfNonNulls() && $child->isListOfNonNulls(); |
|
| 159 | 159 | |
| 160 | 160 | if ($invalidWrapperInheritance || $invalidListWrapperInheritance) { |
| 161 | 161 | $error = '%s precondition of %s can not be strengthened by %s of %s'; |
@@ -98,7 +98,7 @@ |
||
| 98 | 98 | */ |
| 99 | 99 | public function add(string $factory, string $group = null): Factory |
| 100 | 100 | { |
| 101 | - if (! \is_subclass_of($factory, Factory::class)) { |
|
| 101 | + if (!\is_subclass_of($factory, Factory::class)) { |
|
| 102 | 102 | $error = \sprintf('%s must be instance of %s', $factory, Factory::class); |
| 103 | 103 | throw new \InvalidArgumentException($error); |
| 104 | 104 | } |
@@ -45,7 +45,7 @@ |
||
| 45 | 45 | */ |
| 46 | 46 | protected function getDefaultMatcher(): \Closure |
| 47 | 47 | { |
| 48 | - return function (Inheritance\InheritanceValidator $validator, TypeDefinition $a, TypeDefinition $b): bool { |
|
| 48 | + return function(Inheritance\InheritanceValidator $validator, TypeDefinition $a, TypeDefinition $b): bool { |
|
| 49 | 49 | return $validator->match($a, $b); |
| 50 | 50 | }; |
| 51 | 51 | } |
@@ -43,7 +43,7 @@ |
||
| 43 | 43 | */ |
| 44 | 44 | public function addValidator(string $item): self |
| 45 | 45 | { |
| 46 | - if (! \is_subclass_of($item, ValidatorInterface::class)) { |
|
| 46 | + if (!\is_subclass_of($item, ValidatorInterface::class)) { |
|
| 47 | 47 | $error = \sprintf('%s must be instance of %s', $item, ValidatorInterface::class); |
| 48 | 48 | throw new \InvalidArgumentException($error); |
| 49 | 49 | } |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | */ |
| 36 | 36 | protected function getDefaultMatcher(): \Closure |
| 37 | 37 | { |
| 38 | - return function (Definitions\DefinitionValidator $validator, Definition $definition): bool { |
|
| 38 | + return function(Definitions\DefinitionValidator $validator, Definition $definition): bool { |
|
| 39 | 39 | return $validator->match($definition); |
| 40 | 40 | }; |
| 41 | 41 | } |
@@ -51,7 +51,7 @@ |
||
| 51 | 51 | */ |
| 52 | 52 | public function register(TypeDefinition $type, bool $force = false): Dictionary |
| 53 | 53 | { |
| 54 | - if (! $force && $this->has($type->getName())) { |
|
| 54 | + if (!$force && $this->has($type->getName())) { |
|
| 55 | 55 | $error = \sprintf( |
| 56 | 56 | 'Can not declare %s, because the name %s already in use', |
| 57 | 57 | $this->typeToString($type), |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | { |
| 60 | 60 | $type = DocumentBuilder::AST_TYPE_MAPPING[$ast->getName()] ?? null; |
| 61 | 61 | |
| 62 | - if ($type !== null && ! ($type instanceof ExtendDefinition)) { |
|
| 62 | + if ($type !== null && !($type instanceof ExtendDefinition)) { |
|
| 63 | 63 | /** @var Compilable $virtualType */ |
| 64 | 64 | $virtualType = new $type($ast, $this->getDocument()); |
| 65 | 65 | |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | continue; |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | - $callee = function () use ($extendField): void { |
|
| 137 | + $callee = function() use ($extendField): void { |
|
| 138 | 138 | /** @var BaseFieldsContainer $this */ |
| 139 | 139 | $this->fields[$extendField->getName()] = $extendField; |
| 140 | 140 | }; |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | private function dataFieldExtender(): \Closure |
| 150 | 150 | { |
| 151 | 151 | /** @var FieldDefinition|BaseField $field */ |
| 152 | - return function (FieldDefinition $field): void { |
|
| 152 | + return function(FieldDefinition $field): void { |
|
| 153 | 153 | /** @var BaseField $this */ |
| 154 | 154 | |
| 155 | 155 | // Extend type |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | continue; |
| 192 | 192 | } |
| 193 | 193 | |
| 194 | - $callee = function () use ($extendArgument): void { |
|
| 194 | + $callee = function() use ($extendArgument): void { |
|
| 195 | 195 | /** @var BaseArgumentsContainer $this */ |
| 196 | 196 | $this->arguments[$extendArgument->getName()] = $extendArgument; |
| 197 | 197 | }; |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | private function dataArgumentExtender(): \Closure |
| 207 | 207 | { |
| 208 | 208 | /** @var ArgumentDefinition|BaseArgument $argument */ |
| 209 | - return function (ArgumentDefinition $argument): void { |
|
| 209 | + return function(ArgumentDefinition $argument): void { |
|
| 210 | 210 | /** @var BaseArgument $this */ |
| 211 | 211 | |
| 212 | 212 | // Extend type |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | continue; |
| 242 | 242 | } |
| 243 | 243 | |
| 244 | - $callee = function () use ($extendDirective): void { |
|
| 244 | + $callee = function() use ($extendDirective): void { |
|
| 245 | 245 | /** @var BaseArgumentsContainer $this */ |
| 246 | 246 | $this->arguments[$extendDirective->getName()] = $extendDirective; |
| 247 | 247 | }; |
@@ -170,7 +170,7 @@ |
||
| 170 | 170 | |
| 171 | 171 | // Collect sibling methods |
| 172 | 172 | foreach (\class_uses_recursive(static::class) as $sibling) { |
| 173 | - $method = 'compile' . \class_basename($sibling); |
|
| 173 | + $method = 'compile'.\class_basename($sibling); |
|
| 174 | 174 | |
| 175 | 175 | if (\method_exists($sibling, $method)) { |
| 176 | 176 | $this->siblingActions[] = $method; |