@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | public function testGetMetadataForAbsentClass() |
46 | 46 | { |
47 | 47 | $this->expectException(MappingException::class); |
48 | - $this->cmf->getMetadataFor(__NAMESPACE__ . '\AbsentClass'); |
|
48 | + $this->cmf->getMetadataFor(__NAMESPACE__.'\AbsentClass'); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | public function testGetParentMetadata() |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | { |
62 | 62 | $metadata = $this->createMock(ClassMetadata::class); |
63 | 63 | $cache = new ArrayCache(); |
64 | - $cache->save(ChildEntity::class . '$CLASSMETADATA', $metadata); |
|
64 | + $cache->save(ChildEntity::class.'$CLASSMETADATA', $metadata); |
|
65 | 65 | |
66 | 66 | $this->cmf->setCacheDriver($cache); |
67 | 67 | |
@@ -75,14 +75,14 @@ discard block |
||
75 | 75 | |
76 | 76 | $loadedMetadata = $this->cmf->getMetadataFor(ChildEntity::class); |
77 | 77 | |
78 | - self::assertSame($loadedMetadata, $cache->fetch(ChildEntity::class . '$CLASSMETADATA')); |
|
78 | + self::assertSame($loadedMetadata, $cache->fetch(ChildEntity::class.'$CLASSMETADATA')); |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | public function testGetAliasedMetadata() |
82 | 82 | { |
83 | 83 | $this->cmf->getMetadataFor('prefix:ChildEntity'); |
84 | 84 | |
85 | - self::assertTrue($this->cmf->hasMetadataFor(__NAMESPACE__ . '\ChildEntity')); |
|
85 | + self::assertTrue($this->cmf->hasMetadataFor(__NAMESPACE__.'\ChildEntity')); |
|
86 | 86 | self::assertTrue($this->cmf->hasMetadataFor('prefix:ChildEntity')); |
87 | 87 | } |
88 | 88 | |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | { |
112 | 112 | $classMetadata = $this->createMock(ClassMetadata::class); |
113 | 113 | |
114 | - $this->cmf->fallbackCallback = function () use ($classMetadata) { |
|
114 | + $this->cmf->fallbackCallback = function() use ($classMetadata) { |
|
115 | 115 | return $classMetadata; |
116 | 116 | }; |
117 | 117 | |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | |
123 | 123 | public function testWillFailOnFallbackFailureWithNotLoadedMetadata() |
124 | 124 | { |
125 | - $this->cmf->fallbackCallback = function () { |
|
125 | + $this->cmf->fallbackCallback = function() { |
|
126 | 126 | return null; |
127 | 127 | }; |
128 | 128 | |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | |
186 | 186 | protected function getFqcnFromAlias($namespaceAlias, $simpleClassName) |
187 | 187 | { |
188 | - return __NAMESPACE__ . '\\' . $simpleClassName; |
|
188 | + return __NAMESPACE__.'\\'.$simpleClassName; |
|
189 | 189 | } |
190 | 190 | |
191 | 191 | protected function initialize() |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | |
217 | 217 | protected function onNotFoundMetadata($className) |
218 | 218 | { |
219 | - if (! $this->fallbackCallback) { |
|
219 | + if (!$this->fallbackCallback) { |
|
220 | 220 | return null; |
221 | 221 | } |
222 | 222 |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | $locator->expects($this->once()) |
37 | 37 | ->method('findMappingFile') |
38 | 38 | ->with($this->equalTo('stdClass')) |
39 | - ->will($this->returnValue(__DIR__ . '/_files/stdClass.yml')); |
|
39 | + ->will($this->returnValue(__DIR__.'/_files/stdClass.yml')); |
|
40 | 40 | |
41 | 41 | $driver = new TestFileDriver($locator); |
42 | 42 | |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | $locator->expects($this->once()) |
52 | 52 | ->method('findMappingFile') |
53 | 53 | ->with($this->equalTo('stdClass')) |
54 | - ->will($this->returnValue(__DIR__ . '/_files/stdClass.yml')); |
|
54 | + ->will($this->returnValue(__DIR__.'/_files/stdClass.yml')); |
|
55 | 55 | |
56 | 56 | $driver = new TestFileDriver($locator); |
57 | 57 | |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | |
133 | 133 | public function testNonLocatorFallback() |
134 | 134 | { |
135 | - $driver = new TestFileDriver(__DIR__ . '/_files', '.yml'); |
|
135 | + $driver = new TestFileDriver(__DIR__.'/_files', '.yml'); |
|
136 | 136 | self::assertTrue($driver->isTransient('stdClass2')); |
137 | 137 | self::assertFalse($driver->isTransient('stdClass')); |
138 | 138 | } |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | { |
142 | 142 | $locator = $this->createMock(FileLocator::class); |
143 | 143 | $locator->expects($this->any())->method('getFileExtension')->will($this->returnValue('.yml')); |
144 | - $locator->expects($this->any())->method('getPaths')->will($this->returnValue([__DIR__ . '/_files'])); |
|
144 | + $locator->expects($this->any())->method('getPaths')->will($this->returnValue([__DIR__.'/_files'])); |
|
145 | 145 | return $locator; |
146 | 146 | } |
147 | 147 | } |
@@ -32,7 +32,7 @@ |
||
32 | 32 | public function testGetParentClasses() |
33 | 33 | { |
34 | 34 | $classes = $this->reflectionService->getParentClasses(__CLASS__); |
35 | - self::assertTrue(count($classes) === 0, 'The test class ' . __CLASS__ . ' should have no parents according to static reflection.'); |
|
35 | + self::assertTrue(count($classes) === 0, 'The test class '.__CLASS__.' should have no parents according to static reflection.'); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | public function testGetReflectionClass() |
@@ -36,13 +36,13 @@ |
||
36 | 36 | public function testGetParentClasses() |
37 | 37 | { |
38 | 38 | $classes = $this->reflectionService->getParentClasses(__CLASS__); |
39 | - self::assertTrue(count($classes) >= 1, 'The test class ' . __CLASS__ . ' should have at least one parent.'); |
|
39 | + self::assertTrue(count($classes) >= 1, 'The test class '.__CLASS__.' should have at least one parent.'); |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | public function testGetParentClassesForAbsentClass() |
43 | 43 | { |
44 | 44 | $this->expectException(MappingException::class); |
45 | - $this->reflectionService->getParentClasses(__NAMESPACE__ . '\AbsentClass'); |
|
45 | + $this->reflectionService->getParentClasses(__NAMESPACE__.'\AbsentClass'); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | public function testGetReflectionClass() |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | public function injectObjectManager(ObjectManager $objectManager, ClassMetadata $classMetadata) |
76 | 76 | { |
77 | 77 | if ($objectManager !== self::$objectManager) { |
78 | - throw new \RuntimeException('Trying to use PersistentObject with different ObjectManager instances. ' . |
|
78 | + throw new \RuntimeException('Trying to use PersistentObject with different ObjectManager instances. '. |
|
79 | 79 | 'Was PersistentObject::setObjectManager() called?'); |
80 | 80 | } |
81 | 81 | |
@@ -95,17 +95,17 @@ discard block |
||
95 | 95 | */ |
96 | 96 | private function set($field, $args) |
97 | 97 | { |
98 | - if ($this->cm->hasField($field) && ! $this->cm->isIdentifier($field)) { |
|
98 | + if ($this->cm->hasField($field) && !$this->cm->isIdentifier($field)) { |
|
99 | 99 | $this->$field = $args[0]; |
100 | 100 | } elseif ($this->cm->hasAssociation($field) && $this->cm->isSingleValuedAssociation($field)) { |
101 | 101 | $targetClass = $this->cm->getAssociationTargetClass($field); |
102 | - if (! ($args[0] instanceof $targetClass) && $args[0] !== null) { |
|
103 | - throw new \InvalidArgumentException("Expected persistent object of type '" . $targetClass . "'"); |
|
102 | + if (!($args[0] instanceof $targetClass) && $args[0] !== null) { |
|
103 | + throw new \InvalidArgumentException("Expected persistent object of type '".$targetClass."'"); |
|
104 | 104 | } |
105 | 105 | $this->$field = $args[0]; |
106 | 106 | $this->completeOwningSide($field, $targetClass, $args[0]); |
107 | 107 | } else { |
108 | - throw new \BadMethodCallException("no field with name '" . $field . "' exists on '" . $this->cm->getName() . "'"); |
|
108 | + throw new \BadMethodCallException("no field with name '".$field."' exists on '".$this->cm->getName()."'"); |
|
109 | 109 | } |
110 | 110 | } |
111 | 111 | |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | return $this->$field; |
125 | 125 | } |
126 | 126 | |
127 | - throw new \BadMethodCallException("no field with name '" . $field . "' exists on '" . $this->cm->getName() . "'"); |
|
127 | + throw new \BadMethodCallException("no field with name '".$field."' exists on '".$this->cm->getName()."'"); |
|
128 | 128 | } |
129 | 129 | |
130 | 130 | /** |
@@ -140,14 +140,14 @@ discard block |
||
140 | 140 | { |
141 | 141 | // add this object on the owning side as well, for obvious infinite recursion |
142 | 142 | // reasons this is only done when called on the inverse side. |
143 | - if (! $this->cm->isAssociationInverseSide($field)) { |
|
143 | + if (!$this->cm->isAssociationInverseSide($field)) { |
|
144 | 144 | return; |
145 | 145 | } |
146 | 146 | |
147 | 147 | $mappedByField = $this->cm->getAssociationMappedByTargetField($field); |
148 | 148 | $targetMetadata = self::$objectManager->getClassMetadata($targetClass); |
149 | 149 | |
150 | - $setter = ($targetMetadata->isCollectionValuedAssociation($mappedByField) ? 'add' : 'set') . $mappedByField; |
|
150 | + $setter = ($targetMetadata->isCollectionValuedAssociation($mappedByField) ? 'add' : 'set').$mappedByField; |
|
151 | 151 | $targetObject->$setter($this); |
152 | 152 | } |
153 | 153 | |
@@ -164,15 +164,15 @@ discard block |
||
164 | 164 | */ |
165 | 165 | private function add($field, $args) |
166 | 166 | { |
167 | - if (! $this->cm->hasAssociation($field) || ! $this->cm->isCollectionValuedAssociation($field)) { |
|
168 | - throw new \BadMethodCallException('There is no method add' . $field . '() on ' . $this->cm->getName()); |
|
167 | + if (!$this->cm->hasAssociation($field) || !$this->cm->isCollectionValuedAssociation($field)) { |
|
168 | + throw new \BadMethodCallException('There is no method add'.$field.'() on '.$this->cm->getName()); |
|
169 | 169 | } |
170 | 170 | |
171 | 171 | $targetClass = $this->cm->getAssociationTargetClass($field); |
172 | - if (! ($args[0] instanceof $targetClass)) { |
|
173 | - throw new \InvalidArgumentException("Expected persistent object of type '" . $targetClass . "'"); |
|
172 | + if (!($args[0] instanceof $targetClass)) { |
|
173 | + throw new \InvalidArgumentException("Expected persistent object of type '".$targetClass."'"); |
|
174 | 174 | } |
175 | - if (! ($this->$field instanceof Collection)) { |
|
175 | + if (!($this->$field instanceof Collection)) { |
|
176 | 176 | $this->$field = new ArrayCollection($this->$field ?: []); |
177 | 177 | } |
178 | 178 | $this->$field->add($args[0]); |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | return; |
193 | 193 | } |
194 | 194 | |
195 | - if (! self::$objectManager) { |
|
195 | + if (!self::$objectManager) { |
|
196 | 196 | throw new \RuntimeException('No runtime object manager set. Call PersistentObject#setObjectManager().'); |
197 | 197 | } |
198 | 198 | |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | } elseif ($command === 'add') { |
223 | 223 | $this->add($field, $args); |
224 | 224 | } else { |
225 | - throw new \BadMethodCallException('There is no method ' . $method . ' on ' . $this->cm->getName()); |
|
225 | + throw new \BadMethodCallException('There is no method '.$method.' on '.$this->cm->getName()); |
|
226 | 226 | } |
227 | 227 | } |
228 | 228 | } |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | $name = $this->defaultConnection; |
90 | 90 | } |
91 | 91 | |
92 | - if (! isset($this->connections[$name])) { |
|
92 | + if (!isset($this->connections[$name])) { |
|
93 | 93 | throw new \InvalidArgumentException(sprintf('Doctrine %s Connection named "%s" does not exist.', $this->name, $name)); |
94 | 94 | } |
95 | 95 | |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | $name = $this->defaultManager; |
145 | 145 | } |
146 | 146 | |
147 | - if (! isset($this->managers[$name])) { |
|
147 | + if (!isset($this->managers[$name])) { |
|
148 | 148 | throw new \InvalidArgumentException(sprintf('Doctrine %s Manager named "%s" does not exist.', $this->name, $name)); |
149 | 149 | } |
150 | 150 | |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | // Check for namespace alias |
160 | 160 | if (strpos($class, ':') !== false) { |
161 | 161 | list($namespaceAlias, $simpleClassName) = explode(':', $class, 2); |
162 | - $class = $this->getAliasNamespace($namespaceAlias) . '\\' . $simpleClassName; |
|
162 | + $class = $this->getAliasNamespace($namespaceAlias).'\\'.$simpleClassName; |
|
163 | 163 | } |
164 | 164 | |
165 | 165 | $proxyClass = new \ReflectionClass($class); |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | if ($proxyClass->implementsInterface($this->proxyInterfaceName)) { |
168 | 168 | $parentClass = $proxyClass->getParentClass(); |
169 | 169 | |
170 | - if (! $parentClass) { |
|
170 | + if (!$parentClass) { |
|
171 | 171 | return null; |
172 | 172 | } |
173 | 173 | |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | foreach ($this->managers as $id) { |
178 | 178 | $manager = $this->getService($id); |
179 | 179 | |
180 | - if (! $manager->getMetadataFactory()->isTransient($class)) { |
|
180 | + if (!$manager->getMetadataFactory()->isTransient($class)) { |
|
181 | 181 | return $manager; |
182 | 182 | } |
183 | 183 | } |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | $name = $this->defaultManager; |
222 | 222 | } |
223 | 223 | |
224 | - if (! isset($this->managers[$name])) { |
|
224 | + if (!isset($this->managers[$name])) { |
|
225 | 225 | throw new \InvalidArgumentException(sprintf('Doctrine %s Manager named "%s" does not exist.', $this->name, $name)); |
226 | 226 | } |
227 | 227 |
@@ -19,7 +19,7 @@ |
||
19 | 19 | */ |
20 | 20 | public function getParentClasses($class) |
21 | 21 | { |
22 | - if (! class_exists($class)) { |
|
22 | + if (!class_exists($class)) { |
|
23 | 23 | throw MappingException::nonExistingClass($class); |
24 | 24 | } |
25 | 25 |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | */ |
30 | 30 | public static function pathRequired() |
31 | 31 | { |
32 | - return new self('Specifying the paths to your entities is required ' . |
|
32 | + return new self('Specifying the paths to your entities is required '. |
|
33 | 33 | 'in the AnnotationDriver to retrieve all class names.'); |
34 | 34 | } |
35 | 35 | |
@@ -40,12 +40,12 @@ discard block |
||
40 | 40 | */ |
41 | 41 | public static function fileMappingDriversRequireConfiguredDirectoryPath($path = null) |
42 | 42 | { |
43 | - if (! empty($path)) { |
|
44 | - $path = '[' . $path . ']'; |
|
43 | + if (!empty($path)) { |
|
44 | + $path = '['.$path.']'; |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | return new self(sprintf( |
48 | - 'File mapping drivers must have a valid directory path, ' . |
|
48 | + 'File mapping drivers must have a valid directory path, '. |
|
49 | 49 | 'however the given path %s seems to be incorrect!', |
50 | 50 | $path |
51 | 51 | )); |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | */ |
79 | 79 | public function getAllMetadata() |
80 | 80 | { |
81 | - if (! $this->initialized) { |
|
81 | + if (!$this->initialized) { |
|
82 | 82 | $this->initialize(); |
83 | 83 | } |
84 | 84 | |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | |
177 | 177 | try { |
178 | 178 | if ($this->cacheDriver) { |
179 | - $cached = $this->cacheDriver->fetch($realClassName . $this->cacheSalt); |
|
179 | + $cached = $this->cacheDriver->fetch($realClassName.$this->cacheSalt); |
|
180 | 180 | if ($cached instanceof ClassMetadata) { |
181 | 181 | $this->loadedMetadata[$realClassName] = $cached; |
182 | 182 | |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | } else { |
185 | 185 | foreach ($this->loadMetadata($realClassName) as $loadedClassName) { |
186 | 186 | $this->cacheDriver->save( |
187 | - $loadedClassName . $this->cacheSalt, |
|
187 | + $loadedClassName.$this->cacheSalt, |
|
188 | 188 | $this->loadedMetadata[$loadedClassName], |
189 | 189 | null |
190 | 190 | ); |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | } catch (MappingException $loadingException) { |
197 | 197 | $fallbackMetadataResponse = $this->onNotFoundMetadata($realClassName); |
198 | 198 | |
199 | - if (! $fallbackMetadataResponse) { |
|
199 | + if (!$fallbackMetadataResponse) { |
|
200 | 200 | throw $loadingException; |
201 | 201 | } |
202 | 202 | |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | */ |
278 | 278 | protected function loadMetadata($name) |
279 | 279 | { |
280 | - if (! $this->initialized) { |
|
280 | + if (!$this->initialized) { |
|
281 | 281 | $this->initialize(); |
282 | 282 | } |
283 | 283 | |
@@ -364,7 +364,7 @@ discard block |
||
364 | 364 | */ |
365 | 365 | public function isTransient($class) |
366 | 366 | { |
367 | - if (! $this->initialized) { |
|
367 | + if (!$this->initialized) { |
|
368 | 368 | $this->initialize(); |
369 | 369 | } |
370 | 370 |