@@ -250,7 +250,7 @@ |
||
250 | 250 | */ |
251 | 251 | public function __toString(): string |
252 | 252 | { |
253 | - return 'Error-object with ' . ( |
|
253 | + return 'Error-object with '.( |
|
254 | 254 | $this->id === null |
255 | 255 | ? 'no ID' |
256 | 256 | : sprintf('ID: "%s"', $this->id) |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | |
115 | 115 | foreach ($definition->getParameters() as $name => $value) |
116 | 116 | { |
117 | - if (! preg_match('~@(?:(?<namespace>[a-z0-9_\.]+)\:)?(?<name>[a-z0-9_\.]+)~i', $value, $matches)) { |
|
117 | + if (!preg_match('~@(?:(?<namespace>[a-z0-9_\.]+)\:)?(?<name>[a-z0-9_\.]+)~i', $value, $matches)) { |
|
118 | 118 | $resolved[$name] = $value; |
119 | 119 | continue; |
120 | 120 | } |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | continue; |
125 | 125 | } |
126 | 126 | |
127 | - if (! isset($scope[$matches['namespace']])) { |
|
127 | + if (!isset($scope[$matches['namespace']])) { |
|
128 | 128 | throw new \LogicException(sprintf('Object "%s" not found in the scope.', $matches['namespace'])); |
129 | 129 | } |
130 | 130 |
@@ -21,7 +21,7 @@ |
||
21 | 21 | return; |
22 | 22 | } |
23 | 23 | |
24 | - if (! $value instanceof \DateTimeInterface) { |
|
24 | + if (!$value instanceof \DateTimeInterface) { |
|
25 | 25 | $value = new \DateTimeImmutable((string) $value); |
26 | 26 | } |
27 | 27 |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | */ |
55 | 55 | public function getDefinition(string $class): Definition |
56 | 56 | { |
57 | - if (! isset($this->definitions[$class])) { |
|
57 | + if (!isset($this->definitions[$class])) { |
|
58 | 58 | $this->definitions[$class] = $this->provideDefinition($class); |
59 | 59 | } |
60 | 60 | |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | */ |
70 | 70 | public function provideDefinition(string $class): Definition |
71 | 71 | { |
72 | - $key = self::PREFIX . md5($class); |
|
72 | + $key = self::PREFIX.md5($class); |
|
73 | 73 | $item = $this->cache->getItem($key); |
74 | 74 | |
75 | 75 | if ($item->isHit()) { |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | |
62 | 62 | foreach ($options as $option => $value) |
63 | 63 | { |
64 | - if (! in_array($option, static::$possibleOptions, true)) { |
|
64 | + if (!in_array($option, static::$possibleOptions, true)) { |
|
65 | 65 | throw new InvalidOptionException($option, static::$possibleOptions); |
66 | 66 | } |
67 | 67 | |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | $decoded = json_decode($content); |
155 | 155 | |
156 | 156 | if (json_last_error() !== JSON_ERROR_NONE) { |
157 | - throw new \RuntimeException('Decoding error: "' . json_last_error_msg() . '""'); |
|
157 | + throw new \RuntimeException('Decoding error: "'.json_last_error_msg().'""'); |
|
158 | 158 | } |
159 | 159 | |
160 | 160 | return $this->hydrator->hydrate($decoded); |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | $encoded = json_encode($document->toArray()); |
172 | 172 | |
173 | 173 | if (json_last_error() !== JSON_ERROR_NONE) { |
174 | - throw new \RuntimeException('Encoding error: "' . json_last_error_msg() . '""'); |
|
174 | + throw new \RuntimeException('Encoding error: "'.json_last_error_msg().'""'); |
|
175 | 175 | } |
176 | 176 | |
177 | 177 | $stream = fopen('php://memory', 'r+'); |
@@ -86,13 +86,13 @@ |
||
86 | 86 | $exceptionEvent = new ExceptionEvent($request, $exception); |
87 | 87 | $this->dispatcher->dispatch($this->exceptionEvent, $exceptionEvent); |
88 | 88 | |
89 | - if (! $exceptionEvent->hasResponse()) { |
|
89 | + if (!$exceptionEvent->hasResponse()) { |
|
90 | 90 | throw $this->handleException($exception, $request); |
91 | 91 | } |
92 | 92 | |
93 | 93 | $response = $exceptionEvent->getResponse(); |
94 | 94 | |
95 | - if (! $exceptionEvent->isResponseEventEnabled()) { |
|
95 | + if (!$exceptionEvent->isResponseEventEnabled()) { |
|
96 | 96 | return $response; |
97 | 97 | } |
98 | 98 | } |
@@ -55,13 +55,13 @@ |
||
55 | 55 | $type = gettype($value); |
56 | 56 | |
57 | 57 | if ($type === 'object') { |
58 | - return 'an instance of ' . get_class($value); |
|
58 | + return 'an instance of '.get_class($value); |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | if ($type === 'integer') { |
62 | 62 | return 'an integer'; |
63 | 63 | } |
64 | 64 | |
65 | - return 'a ' . $type; |
|
65 | + return 'a '.$type; |
|
66 | 66 | } |
67 | 67 | } |
68 | 68 | \ No newline at end of file |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | |
57 | 57 | $value = $object->$getter(); |
58 | 58 | |
59 | - if ($value === null && ! $definition->getProcessNull()) { |
|
59 | + if ($value === null && !$definition->getProcessNull()) { |
|
60 | 60 | return; |
61 | 61 | } |
62 | 62 | |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | |
75 | 75 | foreach ($definitions as $definition) |
76 | 76 | { |
77 | - if (! $definition->hasSetter()) { |
|
77 | + if (!$definition->hasSetter()) { |
|
78 | 78 | continue; |
79 | 79 | } |
80 | 80 | |
@@ -93,13 +93,13 @@ discard block |
||
93 | 93 | { |
94 | 94 | $name = $definition->getName(); |
95 | 95 | |
96 | - if (! $resource->hasAttribute($name)) { |
|
96 | + if (!$resource->hasAttribute($name)) { |
|
97 | 97 | return; |
98 | 98 | } |
99 | 99 | |
100 | 100 | $value = $resource->getAttribute($name); |
101 | 101 | |
102 | - if ($value === null && ! $definition->getProcessNull()) { |
|
102 | + if ($value === null && !$definition->getProcessNull()) { |
|
103 | 103 | return; |
104 | 104 | } |
105 | 105 |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | */ |
45 | 45 | public function toResource(Attribute $definition, $value) |
46 | 46 | { |
47 | - if (! $definition->hasType()) { |
|
47 | + if (!$definition->hasType()) { |
|
48 | 48 | return $this->processNotTypedToResource($definition, $value); |
49 | 49 | } |
50 | 50 | |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | */ |
67 | 67 | public function fromResource(Attribute $definition, $value) |
68 | 68 | { |
69 | - if (! $definition->hasType()) { |
|
69 | + if (!$definition->hasType()) { |
|
70 | 70 | return $this->processNotTypedFromResource($definition, $value); |
71 | 71 | } |
72 | 72 | |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | */ |
91 | 91 | protected function processNotTypedToResource(Attribute $definition, $value) |
92 | 92 | { |
93 | - if (! $definition->isMany()) { |
|
93 | + if (!$definition->isMany()) { |
|
94 | 94 | return $value; |
95 | 95 | } |
96 | 96 | |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | */ |
117 | 117 | protected function processNotTypedFromResource(Attribute $definition, $value) |
118 | 118 | { |
119 | - if (! $definition->isMany()) { |
|
119 | + if (!$definition->isMany()) { |
|
120 | 120 | return $value; |
121 | 121 | } |
122 | 122 | |
@@ -146,11 +146,11 @@ discard block |
||
146 | 146 | $handler = $this->handlers[$type]; |
147 | 147 | $parameters = $definition->getTypeParameters(); |
148 | 148 | |
149 | - if (! $definition->isMany()) { |
|
149 | + if (!$definition->isMany()) { |
|
150 | 150 | return $handler->toResource($value, $type, $parameters); |
151 | 151 | } |
152 | 152 | |
153 | - if (! $value instanceof \Traversable && ! is_array($value)) { |
|
153 | + if (!$value instanceof \Traversable && !is_array($value)) { |
|
154 | 154 | throw new NotIterableAttribute($definition, $value); |
155 | 155 | } |
156 | 156 | |
@@ -178,11 +178,11 @@ discard block |
||
178 | 178 | $handler = $this->handlers[$type]; |
179 | 179 | $parameters = $definition->getTypeParameters(); |
180 | 180 | |
181 | - if (! $definition->isMany()) { |
|
181 | + if (!$definition->isMany()) { |
|
182 | 182 | return $handler->fromResource($value, $type, $parameters); |
183 | 183 | } |
184 | 184 | |
185 | - if (! $value instanceof \Traversable && ! is_array($value)) { |
|
185 | + if (!$value instanceof \Traversable && !is_array($value)) { |
|
186 | 186 | throw new NotIterableAttribute($definition, $value); |
187 | 187 | } |
188 | 188 |