@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | { |
70 | 70 | $parentType = $parent->getTypeDefinition(); |
71 | 71 | |
72 | - if (! ($child->getTypeDefinition() instanceof $parentType)) { |
|
72 | + if (!($child->getTypeDefinition() instanceof $parentType)) { |
|
73 | 73 | $this->throwScalarIncompatibilityException($child, $parent); |
74 | 74 | } |
75 | 75 | } |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | { |
85 | 85 | $childType = $child->getTypeDefinition(); |
86 | 86 | |
87 | - if (! ($parent->getTypeDefinition() instanceof $childType)) { |
|
87 | + if (!($parent->getTypeDefinition() instanceof $childType)) { |
|
88 | 88 | $this->throwScalarIncompatibilityException($child, $parent); |
89 | 89 | } |
90 | 90 | } |
@@ -40,7 +40,7 @@ |
||
40 | 40 | { |
41 | 41 | \assert($parent->getTypeDefinition() instanceof EnumDefinition); |
42 | 42 | |
43 | - if (! $this->isEqualType($child, $parent)) { |
|
43 | + if (!$this->isEqualType($child, $parent)) { |
|
44 | 44 | $this->throwIncompatibleTypes($child, $parent); |
45 | 45 | } |
46 | 46 | } |
@@ -40,7 +40,7 @@ |
||
40 | 40 | { |
41 | 41 | \assert($parent->getTypeDefinition() instanceof ObjectDefinition); |
42 | 42 | |
43 | - if (! $this->isEqualType($child, $parent)) { |
|
43 | + if (!$this->isEqualType($child, $parent)) { |
|
44 | 44 | $this->throwIncompatibleTypes($child, $parent); |
45 | 45 | } |
46 | 46 | } |
@@ -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 | } |