Completed
Pull Request — master (#50)
by Jonathan
04:44 queued 02:30
created
tests/Doctrine/Tests/Persistence/Mapping/FileDriverTest.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
         $locator->expects($this->once())
38 38
                 ->method('findMappingFile')
39 39
                 ->with($this->equalTo('stdClass'))
40
-                ->will($this->returnValue(__DIR__ . '/_files/stdClass.yml'));
40
+                ->will($this->returnValue(__DIR__.'/_files/stdClass.yml'));
41 41
 
42 42
         $driver = $this->createTestFileDriver($locator);
43 43
 
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
         $locator->expects($this->once())
53 53
             ->method('findMappingFile')
54 54
             ->with($this->equalTo('stdClass'))
55
-            ->will($this->returnValue(__DIR__ . '/_files/stdClass.yml'));
55
+            ->will($this->returnValue(__DIR__.'/_files/stdClass.yml'));
56 56
 
57 57
         $driver = $this->createTestFileDriver($locator);
58 58
 
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
 
136 136
     public function testNonLocatorFallback()
137 137
     {
138
-        $driver = $this->createTestFileDriver(__DIR__ . '/_files', '.yml');
138
+        $driver = $this->createTestFileDriver(__DIR__.'/_files', '.yml');
139 139
         self::assertTrue($driver->isTransient('stdClass2'));
140 140
         self::assertFalse($driver->isTransient('stdClass'));
141 141
     }
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
     {
145 145
         $locator = $this->createMock(FileLocator::class);
146 146
         $locator->expects($this->any())->method('getFileExtension')->will($this->returnValue('.yml'));
147
-        $locator->expects($this->any())->method('getPaths')->will($this->returnValue([__DIR__ . '/_files']));
147
+        $locator->expects($this->any())->method('getPaths')->will($this->returnValue([__DIR__.'/_files']));
148 148
 
149 149
         return $locator;
150 150
     }
Please login to merge, or discard this patch.
lib/Doctrine/Persistence/Mapping/RuntimeReflectionService.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
      */
23 23
     public function getParentClasses(string $class) : array
24 24
     {
25
-        if (! class_exists($class)) {
25
+        if (!class_exists($class)) {
26 26
             throw MappingException::nonExistingClass($class);
27 27
         }
28 28
 
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
@@ -121,11 +121,11 @@  discard block
 block discarded – undo
121 121
      */
122 122
     public function fileExists(string $className) : bool
123 123
     {
124
-        $defaultFileName = str_replace('\\', $this->nsSeparator, $className) . $this->fileExtension;
124
+        $defaultFileName = str_replace('\\', $this->nsSeparator, $className).$this->fileExtension;
125 125
         foreach ($this->paths as $path) {
126
-            if (! isset($this->prefixes[$path])) {
126
+            if (!isset($this->prefixes[$path])) {
127 127
                 // global namespace class
128
-                if (is_file($path . DIRECTORY_SEPARATOR . $defaultFileName)) {
128
+                if (is_file($path.DIRECTORY_SEPARATOR.$defaultFileName)) {
129 129
                     return true;
130 130
                 }
131 131
 
@@ -134,11 +134,11 @@  discard block
 block discarded – undo
134 134
 
135 135
             $prefix = $this->prefixes[$path];
136 136
 
137
-            if (strpos($className, $prefix . '\\') !== 0) {
137
+            if (strpos($className, $prefix.'\\') !== 0) {
138 138
                 continue;
139 139
             }
140 140
 
141
-            $filename = $path . '/' . strtr(substr($className, strlen($prefix) + 1), '\\', $this->nsSeparator) . $this->fileExtension;
141
+            $filename = $path.'/'.strtr(substr($className, strlen($prefix) + 1), '\\', $this->nsSeparator).$this->fileExtension;
142 142
             if (is_file($filename)) {
143 143
                 return true;
144 144
             }
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
 
157 157
         if ($this->paths) {
158 158
             foreach ((array) $this->paths as $path) {
159
-                if (! is_dir($path)) {
159
+                if (!is_dir($path)) {
160 160
                     throw MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path);
161 161
                 }
162 162
 
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
                             '\\'
182 182
                         );
183 183
 
184
-                        $classes[] = $this->prefixes[$path] . str_replace(DIRECTORY_SEPARATOR, '\\', $nsSuffix) . '\\' . str_replace($this->nsSeparator, '\\', $fileName);
184
+                        $classes[] = $this->prefixes[$path].str_replace(DIRECTORY_SEPARATOR, '\\', $nsSuffix).'\\'.str_replace($this->nsSeparator, '\\', $fileName);
185 185
                     } else {
186 186
                         $classes[] = str_replace($this->nsSeparator, '\\', $fileName);
187 187
                     }
@@ -197,11 +197,11 @@  discard block
 block discarded – undo
197 197
      */
198 198
     public function findMappingFile(string $className) : string
199 199
     {
200
-        $defaultFileName = str_replace('\\', $this->nsSeparator, $className) . $this->fileExtension;
200
+        $defaultFileName = str_replace('\\', $this->nsSeparator, $className).$this->fileExtension;
201 201
         foreach ($this->paths as $path) {
202
-            if (! isset($this->prefixes[$path])) {
203
-                if (is_file($path . DIRECTORY_SEPARATOR . $defaultFileName)) {
204
-                    return $path . DIRECTORY_SEPARATOR . $defaultFileName;
202
+            if (!isset($this->prefixes[$path])) {
203
+                if (is_file($path.DIRECTORY_SEPARATOR.$defaultFileName)) {
204
+                    return $path.DIRECTORY_SEPARATOR.$defaultFileName;
205 205
                 }
206 206
 
207 207
                 continue;
@@ -209,16 +209,16 @@  discard block
 block discarded – undo
209 209
 
210 210
             $prefix = $this->prefixes[$path];
211 211
 
212
-            if (strpos($className, $prefix . '\\') !== 0) {
212
+            if (strpos($className, $prefix.'\\') !== 0) {
213 213
                 continue;
214 214
             }
215 215
 
216
-            $filename = $path . '/' . strtr(substr($className, strlen($prefix) + 1), '\\', $this->nsSeparator) . $this->fileExtension;
216
+            $filename = $path.'/'.strtr(substr($className, strlen($prefix) + 1), '\\', $this->nsSeparator).$this->fileExtension;
217 217
             if (is_file($filename)) {
218 218
                 return $filename;
219 219
             }
220 220
         }
221 221
 
222
-        throw MappingException::mappingFileNotFound($className, substr($className, strrpos($className, '\\') + 1) . $this->fileExtension);
222
+        throw MappingException::mappingFileNotFound($className, substr($className, strrpos($className, '\\') + 1).$this->fileExtension);
223 223
     }
224 224
 }
Please login to merge, or discard this patch.
lib/Doctrine/Persistence/Mapping/Driver/StaticPHPDriver.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
             return $this->classNames;
73 73
         }
74 74
 
75
-        if (! $this->paths) {
75
+        if (!$this->paths) {
76 76
             throw MappingException::pathRequired();
77 77
         }
78 78
 
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
         $includedFiles = [];
81 81
 
82 82
         foreach ($this->paths as $path) {
83
-            if (! is_dir($path)) {
83
+            if (!is_dir($path)) {
84 84
                 throw MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path);
85 85
             }
86 86
 
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
         foreach ($declared as $className) {
106 106
             $rc         = new ReflectionClass($className);
107 107
             $sourceFile = $rc->getFileName();
108
-            if (! in_array($sourceFile, $includedFiles) || $this->isTransient($className)) {
108
+            if (!in_array($sourceFile, $includedFiles) || $this->isTransient($className)) {
109 109
                 continue;
110 110
             }
111 111
 
@@ -122,6 +122,6 @@  discard block
 block discarded – undo
122 122
      */
123 123
     public function isTransient(string $className) : bool
124 124
     {
125
-        return ! method_exists($className, 'loadMetadata');
125
+        return !method_exists($className, 'loadMetadata');
126 126
     }
127 127
 }
Please login to merge, or discard this patch.
lib/Doctrine/Persistence/Mapping/Driver/DefaultFileLocator.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -90,12 +90,12 @@  discard block
 block discarded – undo
90 90
      */
91 91
     public function findMappingFile(string $className) : string
92 92
     {
93
-        $fileName = str_replace('\\', '.', $className) . $this->fileExtension;
93
+        $fileName = str_replace('\\', '.', $className).$this->fileExtension;
94 94
 
95 95
         // Check whether file exists
96 96
         foreach ($this->paths as $path) {
97
-            if (is_file($path . DIRECTORY_SEPARATOR . $fileName)) {
98
-                return $path . DIRECTORY_SEPARATOR . $fileName;
97
+            if (is_file($path.DIRECTORY_SEPARATOR.$fileName)) {
98
+                return $path.DIRECTORY_SEPARATOR.$fileName;
99 99
             }
100 100
         }
101 101
 
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 
112 112
         if ($this->paths) {
113 113
             foreach ($this->paths as $path) {
114
-                if (! is_dir($path)) {
114
+                if (!is_dir($path)) {
115 115
                     throw MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path);
116 116
                 }
117 117
 
@@ -141,11 +141,11 @@  discard block
 block discarded – undo
141 141
      */
142 142
     public function fileExists(string $className) : bool
143 143
     {
144
-        $fileName = str_replace('\\', '.', $className) . $this->fileExtension;
144
+        $fileName = str_replace('\\', '.', $className).$this->fileExtension;
145 145
 
146 146
         // Check whether file exists
147 147
         foreach ((array) $this->paths as $path) {
148
-            if (is_file($path . DIRECTORY_SEPARATOR . $fileName)) {
148
+            if (is_file($path.DIRECTORY_SEPARATOR.$fileName)) {
149 149
                 return true;
150 150
             }
151 151
         }
Please login to merge, or discard this patch.
lib/Doctrine/Persistence/Mapping/Driver/AnnotationDriver.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
     {
81 81
         $this->reader = $reader;
82 82
 
83
-        if (! $paths) {
83
+        if (!$paths) {
84 84
             return;
85 85
         }
86 86
 
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
             return $this->classNames;
185 185
         }
186 186
 
187
-        if (! $this->paths) {
187
+        if (!$this->paths) {
188 188
             throw MappingException::pathRequired();
189 189
         }
190 190
 
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
         $includedFiles = [];
193 193
 
194 194
         foreach ($this->paths as $path) {
195
-            if (! is_dir($path)) {
195
+            if (!is_dir($path)) {
196 196
                 throw MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path);
197 197
             }
198 198
 
@@ -201,14 +201,14 @@  discard block
 block discarded – undo
201 201
                     new RecursiveDirectoryIterator($path, FilesystemIterator::SKIP_DOTS),
202 202
                     RecursiveIteratorIterator::LEAVES_ONLY
203 203
                 ),
204
-                '/^.+' . preg_quote($this->fileExtension) . '$/i',
204
+                '/^.+'.preg_quote($this->fileExtension).'$/i',
205 205
                 RecursiveRegexIterator::GET_MATCH
206 206
             );
207 207
 
208 208
             foreach ($iterator as $file) {
209 209
                 $sourceFile = $file[0];
210 210
 
211
-                if (! preg_match('(^phar:)i', $sourceFile)) {
211
+                if (!preg_match('(^phar:)i', $sourceFile)) {
212 212
                     $sourceFile = realpath($sourceFile);
213 213
                 }
214 214
 
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
         foreach ($declared as $className) {
236 236
             $rc         = new ReflectionClass($className);
237 237
             $sourceFile = $rc->getFileName();
238
-            if (! in_array($sourceFile, $includedFiles) || $this->isTransient($className)) {
238
+            if (!in_array($sourceFile, $includedFiles) || $this->isTransient($className)) {
239 239
                 continue;
240 240
             }
241 241
 
Please login to merge, or discard this patch.
lib/Doctrine/Persistence/Mapping/MappingException.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -26,18 +26,18 @@
 block discarded – undo
26 26
 
27 27
     public static function pathRequired() : self
28 28
     {
29
-        return new self('Specifying the paths to your entities is required ' .
29
+        return new self('Specifying the paths to your entities is required '.
30 30
             'in the AnnotationDriver to retrieve all class names.');
31 31
     }
32 32
 
33 33
     public static function fileMappingDriversRequireConfiguredDirectoryPath(?string $path = null) : self
34 34
     {
35
-        if (! empty($path)) {
36
-            $path = '[' . $path . ']';
35
+        if (!empty($path)) {
36
+            $path = '['.$path.']';
37 37
         }
38 38
 
39 39
         return new self(sprintf(
40
-            'File mapping drivers must have a valid directory path, ' .
40
+            'File mapping drivers must have a valid directory path, '.
41 41
             'however the given path %s seems to be incorrect!',
42 42
             $path
43 43
         ));
Please login to merge, or discard this patch.
lib/Doctrine/Persistence/Mapping/AbstractClassMetadataFactory.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
      */
76 76
     public function getAllMetadata() : array
77 77
     {
78
-        if (! $this->initialized) {
78
+        if (!$this->initialized) {
79 79
             $this->initialize();
80 80
         }
81 81
 
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
 
154 154
         try {
155 155
             if ($this->cacheDriver) {
156
-                $cached = $this->cacheDriver->fetch($realClassName . $this->cacheSalt);
156
+                $cached = $this->cacheDriver->fetch($realClassName.$this->cacheSalt);
157 157
                 if ($cached instanceof ClassMetadata) {
158 158
                     $this->loadedMetadata[$realClassName] = $cached;
159 159
 
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
                 } else {
162 162
                     foreach ($this->loadMetadata($realClassName) as $loadedClassName) {
163 163
                         $this->cacheDriver->save(
164
-                            $loadedClassName . $this->cacheSalt,
164
+                            $loadedClassName.$this->cacheSalt,
165 165
                             $this->loadedMetadata[$loadedClassName],
166 166
                             0
167 167
                         );
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
         } catch (MappingException $loadingException) {
174 174
             $fallbackMetadataResponse = $this->onNotFoundMetadata($realClassName);
175 175
 
176
-            if (! $fallbackMetadataResponse) {
176
+            if (!$fallbackMetadataResponse) {
177 177
                 throw $loadingException;
178 178
             }
179 179
 
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
      */
248 248
     protected function loadMetadata($name)
249 249
     {
250
-        if (! $this->initialized) {
250
+        if (!$this->initialized) {
251 251
             $this->initialize();
252 252
         }
253 253
 
@@ -334,7 +334,7 @@  discard block
 block discarded – undo
334 334
      */
335 335
     public function isTransient(string $class) : bool
336 336
     {
337
-        if (! $this->initialized) {
337
+        if (!$this->initialized) {
338 338
             $this->initialize();
339 339
         }
340 340
 
@@ -374,7 +374,7 @@  discard block
 block discarded – undo
374 374
      */
375 375
     private function getRealClass(string $class) : string
376 376
     {
377
-        $pos = strrpos($class, '\\' . Proxy::MARKER . '\\');
377
+        $pos = strrpos($class, '\\'.Proxy::MARKER.'\\');
378 378
 
379 379
         if ($pos === false) {
380 380
             return $class;
Please login to merge, or discard this patch.
lib/Doctrine/Persistence/AbstractManagerRegistry.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
             $name = $this->defaultConnection;
89 89
         }
90 90
 
91
-        if (! isset($this->connections[$name])) {
91
+        if (!isset($this->connections[$name])) {
92 92
             throw new InvalidArgumentException(sprintf('Doctrine %s Connection named "%s" does not exist.', $this->name, $name));
93 93
         }
94 94
 
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
             $name = $this->defaultManager;
144 144
         }
145 145
 
146
-        if (! isset($this->managers[$name])) {
146
+        if (!isset($this->managers[$name])) {
147 147
             throw new InvalidArgumentException(sprintf('Doctrine %s Manager named "%s" does not exist.', $this->name, $name));
148 148
         }
149 149
 
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
         // Check for namespace alias
162 162
         if (strpos($class, ':') !== false) {
163 163
             [$namespaceAlias, $simpleClassName] = explode(':', $class, 2);
164
-            $class                              = $this->getAliasNamespace($namespaceAlias) . '\\' . $simpleClassName;
164
+            $class                              = $this->getAliasNamespace($namespaceAlias).'\\'.$simpleClassName;
165 165
         }
166 166
 
167 167
         $proxyClass = new ReflectionClass($class);
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
         if ($proxyClass->implementsInterface($this->proxyInterfaceName)) {
170 170
             $parentClass = $proxyClass->getParentClass();
171 171
 
172
-            if (! $parentClass) {
172
+            if (!$parentClass) {
173 173
                 return null;
174 174
             }
175 175
 
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
             /** @var ObjectManager $manager */
181 181
             $manager = $this->getService($id);
182 182
 
183
-            if (! $manager->getMetadataFactory()->isTransient($class)) {
183
+            if (!$manager->getMetadataFactory()->isTransient($class)) {
184 184
                 return $manager;
185 185
             }
186 186
         }
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
             $name = $this->defaultManager;
230 230
         }
231 231
 
232
-        if (! isset($this->managers[$name])) {
232
+        if (!isset($this->managers[$name])) {
233 233
             throw new InvalidArgumentException(sprintf('Doctrine %s Manager named "%s" does not exist.', $this->name, $name));
234 234
         }
235 235
 
Please login to merge, or discard this patch.