Passed
Pull Request — 1.3.x (#115)
by Grégoire
09:46
created
tests/Doctrine/Tests/Common/Persistence/ObjectManagerDecoratorTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@
 block discarded – undo
61 61
      */
62 62
     public function testAllMethodCallsAreDelegatedToTheWrappedInstance($method, array $parameters, $isVoidMethod)
63 63
     {
64
-        $returnedValue = $isVoidMethod ? null : 'INNER VALUE FROM ' . $method;
64
+        $returnedValue = $isVoidMethod ? null : 'INNER VALUE FROM '.$method;
65 65
         $stub          = $this->wrapped
66 66
             ->expects($this->once())
67 67
             ->method($method)
Please login to merge, or discard this patch.
tests/Doctrine/Tests/Common/Persistence/PersistentObjectTest.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
 
178 178
     public function getAssociationTargetClass($assocName)
179 179
     {
180
-        return __NAMESPACE__ . '\TestObject';
180
+        return __NAMESPACE__.'\TestObject';
181 181
     }
182 182
 
183 183
     public function getFieldNames()
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 
193 193
     public function getName()
194 194
     {
195
-        return __NAMESPACE__ . '\TestObject';
195
+        return __NAMESPACE__.'\TestObject';
196 196
     }
197 197
 
198 198
     public function getReflectionClass()
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
         $this->cm = new TestObjectMetadata();
36 36
         $this->om = $this->createMock(ObjectManager::class);
37 37
         $this->om->expects($this->any())->method('getClassMetadata')
38
-                 ->will($this->returnValue($this->cm));
38
+                    ->will($this->returnValue($this->cm));
39 39
         $this->object = new TestObject();
40 40
         PersistentObject::setObjectManager($this->om);
41 41
         $this->object->injectObjectManager($this->om, $this->cm);
Please login to merge, or discard this patch.
tests/Doctrine/Tests/Common/Persistence/Mapping/AnnotationDriverTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
     public function testGetAllClassNames()
14 14
     {
15 15
         $reader = new AnnotationReader();
16
-        $driver = new SimpleAnnotationDriver($reader, [__DIR__ . '/_files/annotation']);
16
+        $driver = new SimpleAnnotationDriver($reader, [__DIR__.'/_files/annotation']);
17 17
 
18 18
         $classes = $driver->getAllClassNames();
19 19
 
Please login to merge, or discard this patch.
tests/Doctrine/Tests/Common/Persistence/Mapping/PHPDriverTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
         $metadata = $this->createMock(ClassMetadata::class);
17 17
         $metadata->expects($this->once())->method('getFieldNames');
18 18
 
19
-        $driver = new PHPDriver([__DIR__ . '/_files']);
19
+        $driver = new PHPDriver([__DIR__.'/_files']);
20 20
         $driver->loadMetadataForClass('TestEntity', $metadata);
21 21
     }
22 22
 }
Please login to merge, or discard this patch.
tests/Doctrine/Tests/Common/Persistence/Mapping/DefaultFileLocatorTest.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 {
13 13
     public function testGetPaths()
14 14
     {
15
-        $path = __DIR__ . '/_files';
15
+        $path = __DIR__.'/_files';
16 16
 
17 17
         $locator = new DefaultFileLocator([$path]);
18 18
         self::assertSame([$path], $locator->getPaths());
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 
32 32
     public function testUniquePaths()
33 33
     {
34
-        $path = __DIR__ . '/_files';
34
+        $path = __DIR__.'/_files';
35 35
 
36 36
         $locator = new DefaultFileLocator([$path, $path]);
37 37
         self::assertSame([$path], $locator->getPaths());
@@ -39,16 +39,16 @@  discard block
 block discarded – undo
39 39
 
40 40
     public function testFindMappingFile()
41 41
     {
42
-        $path = __DIR__ . '/_files';
42
+        $path = __DIR__.'/_files';
43 43
 
44 44
         $locator = new DefaultFileLocator([$path], '.yml');
45 45
 
46
-        self::assertSame(__DIR__ . '/_files' . DIRECTORY_SEPARATOR . 'stdClass.yml', $locator->findMappingFile('stdClass'));
46
+        self::assertSame(__DIR__.'/_files'.DIRECTORY_SEPARATOR.'stdClass.yml', $locator->findMappingFile('stdClass'));
47 47
     }
48 48
 
49 49
     public function testFindMappingFileNotFound()
50 50
     {
51
-        $path = __DIR__ . '/_files';
51
+        $path = __DIR__.'/_files';
52 52
 
53 53
         $locator = new DefaultFileLocator([$path], '.yml');
54 54
 
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 
60 60
     public function testGetAllClassNames()
61 61
     {
62
-        $path = __DIR__ . '/_files';
62
+        $path = __DIR__.'/_files';
63 63
 
64 64
         $locator       = new DefaultFileLocator([$path], '.yml');
65 65
         $allClasses    = $locator->getAllClassNames(null);
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 
80 80
     public function testGetAllClassNamesNonMatchingFileExtension()
81 81
     {
82
-        $path = __DIR__ . '/_files';
82
+        $path = __DIR__.'/_files';
83 83
 
84 84
         $locator = new DefaultFileLocator([$path], '.xml');
85 85
         self::assertSame([], $locator->getAllClassNames('global'));
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 
88 88
     public function testFileExists()
89 89
     {
90
-        $path = __DIR__ . '/_files';
90
+        $path = __DIR__.'/_files';
91 91
 
92 92
         $locator = new DefaultFileLocator([$path], '.yml');
93 93
 
Please login to merge, or discard this patch.
lib/Doctrine/Common/Persistence/PersistentObject.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
     public function injectObjectManager(ObjectManager $objectManager, ClassMetadata $classMetadata)
77 77
     {
78 78
         if ($objectManager !== self::$objectManager) {
79
-            throw new RuntimeException('Trying to use PersistentObject with different ObjectManager instances. ' .
79
+            throw new RuntimeException('Trying to use PersistentObject with different ObjectManager instances. '.
80 80
                 'Was PersistentObject::setObjectManager() called?');
81 81
         }
82 82
 
@@ -96,17 +96,17 @@  discard block
 block discarded – undo
96 96
      */
97 97
     private function set($field, $args)
98 98
     {
99
-        if ($this->cm->hasField($field) && ! $this->cm->isIdentifier($field)) {
99
+        if ($this->cm->hasField($field) && !$this->cm->isIdentifier($field)) {
100 100
             $this->$field = $args[0];
101 101
         } elseif ($this->cm->hasAssociation($field) && $this->cm->isSingleValuedAssociation($field)) {
102 102
             $targetClass = $this->cm->getAssociationTargetClass($field);
103
-            if (! ($args[0] instanceof $targetClass) && $args[0] !== null) {
104
-                throw new InvalidArgumentException("Expected persistent object of type '" . $targetClass . "'");
103
+            if (!($args[0] instanceof $targetClass) && $args[0] !== null) {
104
+                throw new InvalidArgumentException("Expected persistent object of type '".$targetClass."'");
105 105
             }
106 106
             $this->$field = $args[0];
107 107
             $this->completeOwningSide($field, $targetClass, $args[0]);
108 108
         } else {
109
-            throw new BadMethodCallException("no field with name '" . $field . "' exists on '" . $this->cm->getName() . "'");
109
+            throw new BadMethodCallException("no field with name '".$field."' exists on '".$this->cm->getName()."'");
110 110
         }
111 111
     }
112 112
 
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
             return $this->$field;
126 126
         }
127 127
 
128
-        throw new BadMethodCallException("no field with name '" . $field . "' exists on '" . $this->cm->getName() . "'");
128
+        throw new BadMethodCallException("no field with name '".$field."' exists on '".$this->cm->getName()."'");
129 129
     }
130 130
 
131 131
     /**
@@ -141,14 +141,14 @@  discard block
 block discarded – undo
141 141
     {
142 142
         // add this object on the owning side as well, for obvious infinite recursion
143 143
         // reasons this is only done when called on the inverse side.
144
-        if (! $this->cm->isAssociationInverseSide($field)) {
144
+        if (!$this->cm->isAssociationInverseSide($field)) {
145 145
             return;
146 146
         }
147 147
 
148 148
         $mappedByField  = $this->cm->getAssociationMappedByTargetField($field);
149 149
         $targetMetadata = self::$objectManager->getClassMetadata($targetClass);
150 150
 
151
-        $setter = ($targetMetadata->isCollectionValuedAssociation($mappedByField) ? 'add' : 'set') . $mappedByField;
151
+        $setter = ($targetMetadata->isCollectionValuedAssociation($mappedByField) ? 'add' : 'set').$mappedByField;
152 152
         $targetObject->$setter($this);
153 153
     }
154 154
 
@@ -165,15 +165,15 @@  discard block
 block discarded – undo
165 165
      */
166 166
     private function add($field, $args)
167 167
     {
168
-        if (! $this->cm->hasAssociation($field) || ! $this->cm->isCollectionValuedAssociation($field)) {
169
-            throw new BadMethodCallException('There is no method add' . $field . '() on ' . $this->cm->getName());
168
+        if (!$this->cm->hasAssociation($field) || !$this->cm->isCollectionValuedAssociation($field)) {
169
+            throw new BadMethodCallException('There is no method add'.$field.'() on '.$this->cm->getName());
170 170
         }
171 171
 
172 172
         $targetClass = $this->cm->getAssociationTargetClass($field);
173
-        if (! ($args[0] instanceof $targetClass)) {
174
-            throw new InvalidArgumentException("Expected persistent object of type '" . $targetClass . "'");
173
+        if (!($args[0] instanceof $targetClass)) {
174
+            throw new InvalidArgumentException("Expected persistent object of type '".$targetClass."'");
175 175
         }
176
-        if (! ($this->$field instanceof Collection)) {
176
+        if (!($this->$field instanceof Collection)) {
177 177
             $this->$field = new ArrayCollection($this->$field ?: []);
178 178
         }
179 179
         $this->$field->add($args[0]);
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
             return;
194 194
         }
195 195
 
196
-        if (! self::$objectManager) {
196
+        if (!self::$objectManager) {
197 197
             throw new RuntimeException('No runtime object manager set. Call PersistentObject#setObjectManager().');
198 198
         }
199 199
 
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
         } elseif ($command === 'add') {
224 224
             $this->add($field, $args);
225 225
         } else {
226
-            throw new BadMethodCallException('There is no method ' . $method . ' on ' . $this->cm->getName());
226
+            throw new BadMethodCallException('There is no method '.$method.' on '.$this->cm->getName());
227 227
         }
228 228
     }
229 229
 }
Please login to merge, or discard this patch.
Doctrine/Tests/Common/Persistence/Mapping/StaticReflectionServiceTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
34 34
     public function testGetParentClasses()
35 35
     {
36 36
         $classes = $this->reflectionService->getParentClasses(self::class);
37
-        self::assertTrue(count($classes) === 0, 'The test class ' . self::class . ' should have no parents according to static reflection.');
37
+        self::assertTrue(count($classes) === 0, 'The test class '.self::class.' should have no parents according to static reflection.');
38 38
     }
39 39
 
40 40
     public function testGetReflectionClass()
Please login to merge, or discard this patch.
Doctrine/Tests/Common/Persistence/Mapping/RuntimeReflectionServiceTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -38,13 +38,13 @@
 block discarded – undo
38 38
     public function testGetParentClasses()
39 39
     {
40 40
         $classes = $this->reflectionService->getParentClasses(self::class);
41
-        self::assertTrue(count($classes) >= 1, 'The test class ' . self::class . ' should have at least one parent.');
41
+        self::assertTrue(count($classes) >= 1, 'The test class '.self::class.' should have at least one parent.');
42 42
     }
43 43
 
44 44
     public function testGetParentClassesForAbsentClass()
45 45
     {
46 46
         $this->expectException(MappingException::class);
47
-        $this->reflectionService->getParentClasses(__NAMESPACE__ . '\AbsentClass');
47
+        $this->reflectionService->getParentClasses(__NAMESPACE__.'\AbsentClass');
48 48
     }
49 49
 
50 50
     public function testGetReflectionClass()
Please login to merge, or discard this patch.
lib/Doctrine/Persistence/Mapping/Driver/SymfonyFileLocator.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -124,11 +124,11 @@  discard block
 block discarded – undo
124 124
      */
125 125
     public function fileExists($className)
126 126
     {
127
-        $defaultFileName = str_replace('\\', $this->nsSeparator, $className) . $this->fileExtension;
127
+        $defaultFileName = str_replace('\\', $this->nsSeparator, $className).$this->fileExtension;
128 128
         foreach ($this->paths as $path) {
129
-            if (! isset($this->prefixes[$path])) {
129
+            if (!isset($this->prefixes[$path])) {
130 130
                 // global namespace class
131
-                if (is_file($path . DIRECTORY_SEPARATOR . $defaultFileName)) {
131
+                if (is_file($path.DIRECTORY_SEPARATOR.$defaultFileName)) {
132 132
                     return true;
133 133
                 }
134 134
 
@@ -137,11 +137,11 @@  discard block
 block discarded – undo
137 137
 
138 138
             $prefix = $this->prefixes[$path];
139 139
 
140
-            if (strpos($className, $prefix . '\\') !== 0) {
140
+            if (strpos($className, $prefix.'\\') !== 0) {
141 141
                 continue;
142 142
             }
143 143
 
144
-            $filename = $path . '/' . strtr(substr($className, strlen($prefix) + 1), '\\', $this->nsSeparator) . $this->fileExtension;
144
+            $filename = $path.'/'.strtr(substr($className, strlen($prefix) + 1), '\\', $this->nsSeparator).$this->fileExtension;
145 145
             if (is_file($filename)) {
146 146
                 return true;
147 147
             }
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
 
160 160
         if ($this->paths) {
161 161
             foreach ((array) $this->paths as $path) {
162
-                if (! is_dir($path)) {
162
+                if (!is_dir($path)) {
163 163
                     throw MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path);
164 164
                 }
165 165
 
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
                             '\\'
185 185
                         );
186 186
 
187
-                        $classes[] = $this->prefixes[$path] . str_replace(DIRECTORY_SEPARATOR, '\\', $nsSuffix) . '\\' . str_replace($this->nsSeparator, '\\', $fileName);
187
+                        $classes[] = $this->prefixes[$path].str_replace(DIRECTORY_SEPARATOR, '\\', $nsSuffix).'\\'.str_replace($this->nsSeparator, '\\', $fileName);
188 188
                     } else {
189 189
                         $classes[] = str_replace($this->nsSeparator, '\\', $fileName);
190 190
                     }
@@ -200,11 +200,11 @@  discard block
 block discarded – undo
200 200
      */
201 201
     public function findMappingFile($className)
202 202
     {
203
-        $defaultFileName = str_replace('\\', $this->nsSeparator, $className) . $this->fileExtension;
203
+        $defaultFileName = str_replace('\\', $this->nsSeparator, $className).$this->fileExtension;
204 204
         foreach ($this->paths as $path) {
205
-            if (! isset($this->prefixes[$path])) {
206
-                if (is_file($path . DIRECTORY_SEPARATOR . $defaultFileName)) {
207
-                    return $path . DIRECTORY_SEPARATOR . $defaultFileName;
205
+            if (!isset($this->prefixes[$path])) {
206
+                if (is_file($path.DIRECTORY_SEPARATOR.$defaultFileName)) {
207
+                    return $path.DIRECTORY_SEPARATOR.$defaultFileName;
208 208
                 }
209 209
 
210 210
                 continue;
@@ -212,16 +212,16 @@  discard block
 block discarded – undo
212 212
 
213 213
             $prefix = $this->prefixes[$path];
214 214
 
215
-            if (strpos($className, $prefix . '\\') !== 0) {
215
+            if (strpos($className, $prefix.'\\') !== 0) {
216 216
                 continue;
217 217
             }
218 218
 
219
-            $filename = $path . '/' . strtr(substr($className, strlen($prefix) + 1), '\\', $this->nsSeparator) . $this->fileExtension;
219
+            $filename = $path.'/'.strtr(substr($className, strlen($prefix) + 1), '\\', $this->nsSeparator).$this->fileExtension;
220 220
             if (is_file($filename)) {
221 221
                 return $filename;
222 222
             }
223 223
         }
224 224
 
225
-        throw MappingException::mappingFileNotFound($className, substr($className, strrpos($className, '\\') + 1) . $this->fileExtension);
225
+        throw MappingException::mappingFileNotFound($className, substr($className, strrpos($className, '\\') + 1).$this->fileExtension);
226 226
     }
227 227
 }
Please login to merge, or discard this patch.