@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | } |
120 | 120 | |
121 | 121 | $propertyMetadata = $context->getMetadataStack()->top(); |
122 | - if (!$propertyMetadata instanceof PropertyMetadata) { |
|
122 | + if ( ! $propertyMetadata instanceof PropertyMetadata) { |
|
123 | 123 | return $elements; |
124 | 124 | } |
125 | 125 | |
@@ -137,18 +137,18 @@ discard block |
||
137 | 137 | && $classMetadata->isCollectionValuedAssociation($propertyMetadata->name) |
138 | 138 | ) { |
139 | 139 | $existingCollection = $classMetadata->getFieldValue($currentObject, $propertyMetadata->name); |
140 | - if (!$existingCollection instanceof OrmPersistentCollection) { |
|
140 | + if ( ! $existingCollection instanceof OrmPersistentCollection) { |
|
141 | 141 | return $elements; |
142 | 142 | } |
143 | 143 | |
144 | 144 | foreach ($elements as $element) { |
145 | - if (!$existingCollection->contains($element)) { |
|
145 | + if ( ! $existingCollection->contains($element)) { |
|
146 | 146 | $existingCollection->add($element); |
147 | 147 | } |
148 | 148 | } |
149 | 149 | |
150 | 150 | foreach ($existingCollection as $collectionElement) { |
151 | - if (!$elements->contains($collectionElement)) { |
|
151 | + if ( ! $elements->contains($collectionElement)) { |
|
152 | 152 | $existingCollection->removeElement($collectionElement); |
153 | 153 | } |
154 | 154 | } |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | public function visitDouble(float $data, array $type) |
72 | 72 | { |
73 | 73 | $percision = $type['params'][0] ?? null; |
74 | - if (!is_int($percision)) { |
|
74 | + if ( ! is_int($percision)) { |
|
75 | 75 | return $data; |
76 | 76 | } |
77 | 77 | |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | |
94 | 94 | $rs = isset($type['params'][1]) ? new \ArrayObject() : []; |
95 | 95 | |
96 | - $isList = isset($type['params'][0]) && !isset($type['params'][1]); |
|
96 | + $isList = isset($type['params'][0]) && ! isset($type['params'][1]); |
|
97 | 97 | |
98 | 98 | $elType = $this->getElementType($type); |
99 | 99 | foreach ($data as $k => $v) { |
@@ -28,7 +28,7 @@ |
||
28 | 28 | $relativeDepth = 0; |
29 | 29 | |
30 | 30 | foreach ($context->getMetadataStack() as $metadata) { |
31 | - if (!$metadata instanceof PropertyMetadata) { |
|
31 | + if ( ! $metadata instanceof PropertyMetadata) { |
|
32 | 32 | continue; |
33 | 33 | } |
34 | 34 |
@@ -14,7 +14,7 @@ |
||
14 | 14 | { |
15 | 15 | $classMetadata = new ClassMetadata($name = $class->name); |
16 | 16 | $classMetadata->isEnum = method_exists($class, 'isEnum') ? $class->isEnum() : false; |
17 | - $fileResource = $class->getFilename(); |
|
17 | + $fileResource = $class->getFilename(); |
|
18 | 18 | if (false !== $fileResource) { |
19 | 19 | $classMetadata->fileResources[] = $fileResource; |
20 | 20 | } |
@@ -55,14 +55,14 @@ discard block |
||
55 | 55 | |
56 | 56 | $metadata = new ClassMetadata($name = $class->name); |
57 | 57 | $metadata->isEnum = method_exists($class, 'isEnum') ? $class->isEnum() : false; |
58 | - if (!$elems = $elem->xpath("./class[@name = '" . $name . "']")) { |
|
58 | + if ( ! $elems = $elem->xpath("./class[@name = '".$name."']")) { |
|
59 | 59 | throw new InvalidMetadataException(sprintf('Could not find class %s inside XML element.', $name)); |
60 | 60 | } |
61 | 61 | |
62 | 62 | $elem = reset($elems); |
63 | 63 | |
64 | 64 | $metadata->fileResources[] = $path; |
65 | - $fileResource = $class->getFilename(); |
|
65 | + $fileResource = $class->getFilename(); |
|
66 | 66 | if (false !== $fileResource) { |
67 | 67 | $metadata->fileResources[] = $fileResource; |
68 | 68 | } |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | $discriminatorFieldName = (string) $elem->attributes()->{'discriminator-field-name'}; |
102 | 102 | $discriminatorMap = []; |
103 | 103 | foreach ($elem->xpath('./discriminator-class') as $entry) { |
104 | - if (!isset($entry->attributes()->value)) { |
|
104 | + if ( ! isset($entry->attributes()->value)) { |
|
105 | 105 | throw new InvalidMetadataException('Each discriminator-class element must have a "value" attribute.'); |
106 | 106 | } |
107 | 107 | |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | |
111 | 111 | if ('true' === (string) $elem->attributes()->{'discriminator-disabled'}) { |
112 | 112 | $metadata->discriminatorDisabled = true; |
113 | - } elseif (!empty($discriminatorFieldName) || !empty($discriminatorMap)) { |
|
113 | + } elseif ( ! empty($discriminatorFieldName) || ! empty($discriminatorMap)) { |
|
114 | 114 | $discriminatorGroups = []; |
115 | 115 | foreach ($elem->xpath('./discriminator-groups/group') as $entry) { |
116 | 116 | $discriminatorGroups[] = (string) $entry; |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | } |
121 | 121 | |
122 | 122 | foreach ($elem->xpath('./xml-namespace') as $xmlNamespace) { |
123 | - if (!isset($xmlNamespace->attributes()->uri)) { |
|
123 | + if ( ! isset($xmlNamespace->attributes()->uri)) { |
|
124 | 124 | throw new InvalidMetadataException('The prefix attribute must be set for all xml-namespace elements.'); |
125 | 125 | } |
126 | 126 | |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | $this->parseExpression((string) $method->attributes()->expression) |
156 | 156 | ); |
157 | 157 | } else { |
158 | - if (!isset($method->attributes()->method)) { |
|
158 | + if ( ! isset($method->attributes()->method)) { |
|
159 | 159 | throw new InvalidMetadataException('The method attribute must be set for all virtual-property elements.'); |
160 | 160 | } |
161 | 161 | |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | $propertiesNodes[] = $method; |
167 | 167 | } |
168 | 168 | |
169 | - if (!$excludeAll) { |
|
169 | + if ( ! $excludeAll) { |
|
170 | 170 | foreach ($class->getProperties() as $property) { |
171 | 171 | if ($property->class !== $name || (isset($property->info) && $property->info['class'] !== $name)) { |
172 | 172 | continue; |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | $pName = $property->getName(); |
176 | 176 | $propertiesMetadata[] = new PropertyMetadata($name, $pName); |
177 | 177 | |
178 | - $pElems = $elem->xpath("./property[@name = '" . $pName . "']"); |
|
178 | + $pElems = $elem->xpath("./property[@name = '".$pName."']"); |
|
179 | 179 | $propertiesNodes[] = $pElems ? reset($pElems) : null; |
180 | 180 | } |
181 | 181 | |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | || isset($propertiesNodes[$propertyKey]); |
187 | 187 | |
188 | 188 | $pElem = $propertiesNodes[$propertyKey]; |
189 | - if (!empty($pElem)) { |
|
189 | + if ( ! empty($pElem)) { |
|
190 | 190 | if (null !== $exclude = $pElem->attributes()->exclude) { |
191 | 191 | $isExclude = 'true' === strtolower((string) $exclude); |
192 | 192 | } |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | } |
209 | 209 | |
210 | 210 | if (null !== $excludeIf = $pElem->attributes()->{'expose-if'}) { |
211 | - $pMetadata->excludeIf = $this->parseExpression('!(' . (string) $excludeIf . ')'); |
|
211 | + $pMetadata->excludeIf = $this->parseExpression('!('.(string) $excludeIf.')'); |
|
212 | 212 | $isExpose = true; |
213 | 213 | } |
214 | 214 | |
@@ -336,16 +336,16 @@ discard block |
||
336 | 336 | $metadata->isMap = $metadata->isMap || PropertyMetadata::isCollectionMap($pMetadata->type); |
337 | 337 | } |
338 | 338 | |
339 | - if (!$pMetadata->serializedName) { |
|
339 | + if ( ! $pMetadata->serializedName) { |
|
340 | 340 | $pMetadata->serializedName = $this->namingStrategy->translateName($pMetadata); |
341 | 341 | } |
342 | 342 | |
343 | - if (!empty($pElem) && null !== $name = $pElem->attributes()->name) { |
|
343 | + if ( ! empty($pElem) && null !== $name = $pElem->attributes()->name) { |
|
344 | 344 | $pMetadata->name = (string) $name; |
345 | 345 | } |
346 | 346 | |
347 | 347 | if ( |
348 | - (ExclusionPolicy::NONE === (string) $exclusionPolicy && !$isExclude) |
|
348 | + (ExclusionPolicy::NONE === (string) $exclusionPolicy && ! $isExclude) |
|
349 | 349 | || (ExclusionPolicy::ALL === (string) $exclusionPolicy && $isExpose) |
350 | 350 | ) { |
351 | 351 | $metadata->addPropertyMetadata($pMetadata); |
@@ -354,11 +354,11 @@ discard block |
||
354 | 354 | } |
355 | 355 | |
356 | 356 | foreach ($elem->xpath('./callback-method') as $method) { |
357 | - if (!isset($method->attributes()->type)) { |
|
357 | + if ( ! isset($method->attributes()->type)) { |
|
358 | 358 | throw new InvalidMetadataException('The type attribute must be set for all callback-method elements.'); |
359 | 359 | } |
360 | 360 | |
361 | - if (!isset($method->attributes()->name)) { |
|
361 | + if ( ! isset($method->attributes()->name)) { |
|
362 | 362 | throw new InvalidMetadataException('The name attribute must be set for all callback-method elements.'); |
363 | 363 | } |
364 | 364 | |
@@ -376,11 +376,11 @@ discard block |
||
376 | 376 | break; |
377 | 377 | |
378 | 378 | case 'handler': |
379 | - if (!isset($method->attributes()->format)) { |
|
379 | + if ( ! isset($method->attributes()->format)) { |
|
380 | 380 | throw new InvalidMetadataException('The format attribute must be set for "handler" callback methods.'); |
381 | 381 | } |
382 | 382 | |
383 | - if (!isset($method->attributes()->direction)) { |
|
383 | + if ( ! isset($method->attributes()->direction)) { |
|
384 | 384 | throw new InvalidMetadataException('The direction attribute must be set for "handler" callback methods.'); |
385 | 385 | } |
386 | 386 |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | { |
79 | 79 | $classMetadata = new ClassMetadata($name = $class->name); |
80 | 80 | $classMetadata->isEnum = method_exists($class, 'isEnum') ? $class->isEnum() : false; |
81 | - $fileResource = $class->getFilename(); |
|
81 | + $fileResource = $class->getFilename(); |
|
82 | 82 | if (false !== $fileResource) { |
83 | 83 | $classMetadata->fileResources[] = $fileResource; |
84 | 84 | } |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | } |
159 | 159 | } |
160 | 160 | |
161 | - if (!$excludeAll) { |
|
161 | + if ( ! $excludeAll) { |
|
162 | 162 | foreach ($class->getProperties() as $property) { |
163 | 163 | if ($property->class !== $name || (isset($property->info) && $property->info['class'] !== $name)) { |
164 | 164 | continue; |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | } elseif ($annot instanceof Expose) { |
191 | 191 | $isExpose = true; |
192 | 192 | if (null !== $annot->if) { |
193 | - $propertyMetadata->excludeIf = $this->parseExpression('!(' . $annot->if . ')'); |
|
193 | + $propertyMetadata->excludeIf = $this->parseExpression('!('.$annot->if.')'); |
|
194 | 194 | } |
195 | 195 | } elseif ($annot instanceof Exclude) { |
196 | 196 | if (null !== $annot->if) { |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | throw new InvalidMetadataException(sprintf( |
238 | 238 | 'Invalid group name "%s" on "%s", did you mean to create multiple groups?', |
239 | 239 | implode(', ', $propertyMetadata->groups), |
240 | - $propertyMetadata->class . '->' . $propertyMetadata->name |
|
240 | + $propertyMetadata->class.'->'.$propertyMetadata->name |
|
241 | 241 | )); |
242 | 242 | } |
243 | 243 | } |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | } |
260 | 260 | } |
261 | 261 | |
262 | - if (!$propertyMetadata->serializedName) { |
|
262 | + if ( ! $propertyMetadata->serializedName) { |
|
263 | 263 | $propertyMetadata->serializedName = $this->namingStrategy->translateName($propertyMetadata); |
264 | 264 | } |
265 | 265 | |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | } |
271 | 271 | |
272 | 272 | if ( |
273 | - (ExclusionPolicy::NONE === $exclusionPolicy && !$isExclude) |
|
273 | + (ExclusionPolicy::NONE === $exclusionPolicy && ! $isExclude) |
|
274 | 274 | || (ExclusionPolicy::ALL === $exclusionPolicy && $isExpose) |
275 | 275 | ) { |
276 | 276 | $propertyMetadata->setAccessor($accessType, $accessor[0], $accessor[1]); |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | |
215 | 215 | private function getAccessorStrategy(): AccessorStrategyInterface |
216 | 216 | { |
217 | - if (!$this->accessorStrategy) { |
|
217 | + if ( ! $this->accessorStrategy) { |
|
218 | 218 | $this->accessorStrategy = new DefaultAccessorStrategy($this->expressionEvaluator); |
219 | 219 | } |
220 | 220 | |
@@ -251,11 +251,11 @@ discard block |
||
251 | 251 | |
252 | 252 | public function setCacheDir(string $dir): self |
253 | 253 | { |
254 | - if (!is_dir($dir)) { |
|
254 | + if ( ! is_dir($dir)) { |
|
255 | 255 | $this->createDir($dir); |
256 | 256 | } |
257 | 257 | |
258 | - if (!is_writable($dir)) { |
|
258 | + if ( ! is_writable($dir)) { |
|
259 | 259 | throw new InvalidArgumentException(sprintf('The cache directory "%s" is not writable.', $dir)); |
260 | 260 | } |
261 | 261 | |
@@ -377,7 +377,7 @@ discard block |
||
377 | 377 | public function setMetadataDirs(array $namespacePrefixToDirMap): self |
378 | 378 | { |
379 | 379 | foreach ($namespacePrefixToDirMap as $dir) { |
380 | - if (!is_dir($dir)) { |
|
380 | + if ( ! is_dir($dir)) { |
|
381 | 381 | throw new InvalidArgumentException(sprintf('The directory "%s" does not exist.', $dir)); |
382 | 382 | } |
383 | 383 | } |
@@ -415,7 +415,7 @@ discard block |
||
415 | 415 | */ |
416 | 416 | public function addMetadataDir(string $dir, string $namespacePrefix = ''): self |
417 | 417 | { |
418 | - if (!is_dir($dir)) { |
|
418 | + if ( ! is_dir($dir)) { |
|
419 | 419 | throw new InvalidArgumentException(sprintf('The directory "%s" does not exist.', $dir)); |
420 | 420 | } |
421 | 421 | |
@@ -454,11 +454,11 @@ discard block |
||
454 | 454 | */ |
455 | 455 | public function replaceMetadataDir(string $dir, string $namespacePrefix = ''): self |
456 | 456 | { |
457 | - if (!is_dir($dir)) { |
|
457 | + if ( ! is_dir($dir)) { |
|
458 | 458 | throw new InvalidArgumentException(sprintf('The directory "%s" does not exist.', $dir)); |
459 | 459 | } |
460 | 460 | |
461 | - if (!isset($this->metadataDirs[$namespacePrefix])) { |
|
461 | + if ( ! isset($this->metadataDirs[$namespacePrefix])) { |
|
462 | 462 | throw new InvalidArgumentException(sprintf('There is no directory configured for namespace prefix "%s". Please use addMetadataDir() for adding new directories.', $namespacePrefix)); |
463 | 463 | } |
464 | 464 | |
@@ -553,23 +553,23 @@ discard block |
||
553 | 553 | if (null !== $this->metadataCache) { |
554 | 554 | $metadataFactory->setCache($this->metadataCache); |
555 | 555 | } elseif (null !== $this->cacheDir) { |
556 | - $this->createDir($this->cacheDir . '/metadata'); |
|
557 | - $metadataFactory->setCache(new FileCache($this->cacheDir . '/metadata')); |
|
556 | + $this->createDir($this->cacheDir.'/metadata'); |
|
557 | + $metadataFactory->setCache(new FileCache($this->cacheDir.'/metadata')); |
|
558 | 558 | } |
559 | 559 | |
560 | - if (!$this->handlersConfigured) { |
|
560 | + if ( ! $this->handlersConfigured) { |
|
561 | 561 | $this->addDefaultHandlers(); |
562 | 562 | } |
563 | 563 | |
564 | - if (!$this->listenersConfigured) { |
|
564 | + if ( ! $this->listenersConfigured) { |
|
565 | 565 | $this->addDefaultListeners(); |
566 | 566 | } |
567 | 567 | |
568 | - if (!$this->serializationVisitorsAdded) { |
|
568 | + if ( ! $this->serializationVisitorsAdded) { |
|
569 | 569 | $this->addDefaultSerializationVisitors(); |
570 | 570 | } |
571 | 571 | |
572 | - if (!$this->deserializationVisitorsAdded) { |
|
572 | + if ( ! $this->deserializationVisitorsAdded) { |
|
573 | 573 | $this->addDefaultDeserializationVisitors(); |
574 | 574 | } |
575 | 575 | |
@@ -635,12 +635,12 @@ discard block |
||
635 | 635 | private function decorateAnnotationReader(Reader $annotationReader): Reader |
636 | 636 | { |
637 | 637 | if (null !== $this->cacheDir) { |
638 | - $this->createDir($this->cacheDir . '/annotations'); |
|
638 | + $this->createDir($this->cacheDir.'/annotations'); |
|
639 | 639 | if (class_exists(FilesystemAdapter::class)) { |
640 | - $annotationsCache = new FilesystemAdapter('', 0, $this->cacheDir . '/annotations'); |
|
640 | + $annotationsCache = new FilesystemAdapter('', 0, $this->cacheDir.'/annotations'); |
|
641 | 641 | $annotationReader = new PsrCachedReader($annotationReader, $annotationsCache, $this->debug); |
642 | 642 | } else { |
643 | - $annotationsCache = new FilesystemCache($this->cacheDir . '/annotations'); |
|
643 | + $annotationsCache = new FilesystemCache($this->cacheDir.'/annotations'); |
|
644 | 644 | $annotationReader = new CachedReader($annotationReader, $annotationsCache, $this->debug); |
645 | 645 | } |
646 | 646 | } |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | */ |
57 | 57 | public function getPropertyDocblockTypeHint(\ReflectionProperty $reflectionProperty): ?string |
58 | 58 | { |
59 | - if (!$reflectionProperty->getDocComment()) { |
|
59 | + if ( ! $reflectionProperty->getDocComment()) { |
|
60 | 60 | return null; |
61 | 61 | } |
62 | 62 | |
@@ -91,25 +91,25 @@ discard block |
||
91 | 91 | if ($type instanceof ArrayTypeNode) { |
92 | 92 | $resolvedType = $this->resolveTypeFromTypeNode($type->type, $reflectionProperty); |
93 | 93 | |
94 | - return 'array<' . $resolvedType . '>'; |
|
94 | + return 'array<'.$resolvedType.'>'; |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | // Generic array syntax: array<Product> | array<\Foo\Bar\Product> | array<int,Product> |
98 | 98 | if ($type instanceof GenericTypeNode) { |
99 | 99 | if ($this->isSimpleType($type->type, 'array')) { |
100 | - $resolvedTypes = array_map(function (TypeNode $node) use ($reflectionProperty) { |
|
100 | + $resolvedTypes = array_map(function(TypeNode $node) use ($reflectionProperty) { |
|
101 | 101 | return $this->resolveTypeFromTypeNode($node, $reflectionProperty); |
102 | 102 | }, $type->genericTypes); |
103 | 103 | |
104 | - return 'array<' . implode(',', $resolvedTypes) . '>'; |
|
104 | + return 'array<'.implode(',', $resolvedTypes).'>'; |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | if ($this->isSimpleType($type->type, 'list')) { |
108 | - $resolvedTypes = array_map(function (TypeNode $node) use ($reflectionProperty) { |
|
108 | + $resolvedTypes = array_map(function(TypeNode $node) use ($reflectionProperty) { |
|
109 | 109 | return $this->resolveTypeFromTypeNode($node, $reflectionProperty); |
110 | 110 | }, $type->genericTypes); |
111 | 111 | |
112 | - return 'array<int, ' . implode(',', $resolvedTypes) . '>'; |
|
112 | + return 'array<int, '.implode(',', $resolvedTypes).'>'; |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | throw new \InvalidArgumentException(sprintf("Can't use non-array generic type %s for collection in %s:%s", (string) $type->type, $reflectionProperty->getDeclaringClass()->getName(), $reflectionProperty->getName())); |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | return []; |
133 | 133 | } |
134 | 134 | |
135 | - return array_merge(...array_map(static function (VarTagValueNode $node) { |
|
135 | + return array_merge(...array_map(static function(VarTagValueNode $node) { |
|
136 | 136 | if ($node->type instanceof UnionTypeNode) { |
137 | 137 | return $node->type->types; |
138 | 138 | } |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | */ |
151 | 151 | private function filterNullFromTypes(array $types): array |
152 | 152 | { |
153 | - return array_values(array_filter(array_map(function (TypeNode $node) { |
|
153 | + return array_values(array_filter(array_map(function(TypeNode $node) { |
|
154 | 154 | return $this->isNullType($node) ? null : $node; |
155 | 155 | }, $types))); |
156 | 156 | } |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | */ |
194 | 194 | private function resolveTypeFromTypeNode(TypeNode $typeNode, \ReflectionProperty $reflectionProperty): string |
195 | 195 | { |
196 | - if (!($typeNode instanceof IdentifierTypeNode)) { |
|
196 | + if ( ! ($typeNode instanceof IdentifierTypeNode)) { |
|
197 | 197 | throw new \InvalidArgumentException(sprintf("Can't use unsupported type %s for collection in %s:%s", (string) $typeNode, $reflectionProperty->getDeclaringClass()->getName(), $reflectionProperty->getName())); |
198 | 198 | } |
199 | 199 | |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | return $typeHint; |
207 | 207 | } |
208 | 208 | |
209 | - $expandedClassName = $declaringClass->getNamespaceName() . '\\' . $typeHint; |
|
209 | + $expandedClassName = $declaringClass->getNamespaceName().'\\'.$typeHint; |
|
210 | 210 | if ($this->isClassOrInterface($expandedClassName)) { |
211 | 211 | return $expandedClassName; |
212 | 212 | } |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | |
233 | 233 | private function endsWith(string $statementClassToCheck, string $typeHintToSearchFor): bool |
234 | 234 | { |
235 | - $typeHintToSearchFor = '\\' . $typeHintToSearchFor; |
|
235 | + $typeHintToSearchFor = '\\'.$typeHintToSearchFor; |
|
236 | 236 | |
237 | 237 | return substr($statementClassToCheck, -strlen($typeHintToSearchFor)) === $typeHintToSearchFor; |
238 | 238 | } |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | preg_match_all(self::GROUP_USE_STATEMENTS_REGEX, $classContents, $foundGroupUseStatements); |
254 | 254 | for ($useStatementIndex = 0; $useStatementIndex < count($foundGroupUseStatements[0]); $useStatementIndex++) { |
255 | 255 | foreach (explode(',', $foundGroupUseStatements[2][$useStatementIndex]) as $singleUseStatement) { |
256 | - $foundUseStatements[] = trim($foundGroupUseStatements[1][$useStatementIndex]) . trim($singleUseStatement); |
|
256 | + $foundUseStatements[] = trim($foundGroupUseStatements[1][$useStatementIndex]).trim($singleUseStatement); |
|
257 | 257 | } |
258 | 258 | } |
259 | 259 | |
@@ -286,7 +286,7 @@ discard block |
||
286 | 286 | |
287 | 287 | private function resolveType(string $typeHint, \ReflectionProperty $reflectionProperty): string |
288 | 288 | { |
289 | - if (!$this->hasGlobalNamespacePrefix($typeHint) && !$this->isPrimitiveType($typeHint)) { |
|
289 | + if ( ! $this->hasGlobalNamespacePrefix($typeHint) && ! $this->isPrimitiveType($typeHint)) { |
|
290 | 290 | $typeHint = $this->expandClassNameUsingUseStatements($typeHint, $this->getDeclaringClassOrTrait($reflectionProperty), $reflectionProperty); |
291 | 291 | } |
292 | 292 |