Completed
Pull Request — 1.4.x (#111)
by
unknown
02:45
created
lib/Doctrine/Persistence/Mapping/Driver/StaticPHPDriver.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
             return $this->classNames;
75 75
         }
76 76
 
77
-        if (! $this->paths) {
77
+        if (!$this->paths) {
78 78
             throw MappingException::pathRequired();
79 79
         }
80 80
 
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
         $includedFiles = [];
83 83
 
84 84
         foreach ($this->paths as $path) {
85
-            if (! is_dir($path)) {
85
+            if (!is_dir($path)) {
86 86
                 throw MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path);
87 87
             }
88 88
 
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
         foreach ($declared as $className) {
108 108
             $rc         = new ReflectionClass($className);
109 109
             $sourceFile = $rc->getFileName();
110
-            if (! in_array($sourceFile, $includedFiles) || $this->isTransient($className)) {
110
+            if (!in_array($sourceFile, $includedFiles) || $this->isTransient($className)) {
111 111
                 continue;
112 112
             }
113 113
 
@@ -124,6 +124,6 @@  discard block
 block discarded – undo
124 124
      */
125 125
     public function isTransient($className)
126 126
     {
127
-        return ! method_exists($className, 'loadMetadata');
127
+        return !method_exists($className, 'loadMetadata');
128 128
     }
129 129
 }
Please login to merge, or discard this patch.
lib/Doctrine/Persistence/Mapping/Driver/MappingDriverChain.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -93,7 +93,7 @@
 block discarded – undo
93 93
         foreach ($this->drivers as $namespace => $driver) {
94 94
             $oid = spl_object_hash($driver);
95 95
 
96
-            if (! isset($driverClasses[$oid])) {
96
+            if (!isset($driverClasses[$oid])) {
97 97
                 $driverClasses[$oid] = $driver->getAllClassNames();
98 98
             }
99 99
 
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
@@ -94,12 +94,12 @@  discard block
 block discarded – undo
94 94
      */
95 95
     public function findMappingFile($className)
96 96
     {
97
-        $fileName = str_replace('\\', '.', $className) . $this->fileExtension;
97
+        $fileName = str_replace('\\', '.', $className).$this->fileExtension;
98 98
 
99 99
         // Check whether file exists
100 100
         foreach ($this->paths as $path) {
101
-            if (is_file($path . DIRECTORY_SEPARATOR . $fileName)) {
102
-                return $path . DIRECTORY_SEPARATOR . $fileName;
101
+            if (is_file($path.DIRECTORY_SEPARATOR.$fileName)) {
102
+                return $path.DIRECTORY_SEPARATOR.$fileName;
103 103
             }
104 104
         }
105 105
 
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
 
116 116
         if ($this->paths) {
117 117
             foreach ($this->paths as $path) {
118
-                if (! is_dir($path)) {
118
+                if (!is_dir($path)) {
119 119
                     throw MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path);
120 120
                 }
121 121
 
@@ -145,11 +145,11 @@  discard block
 block discarded – undo
145 145
      */
146 146
     public function fileExists($className)
147 147
     {
148
-        $fileName = str_replace('\\', '.', $className) . $this->fileExtension;
148
+        $fileName = str_replace('\\', '.', $className).$this->fileExtension;
149 149
 
150 150
         // Check whether file exists
151 151
         foreach ((array) $this->paths as $path) {
152
-            if (is_file($path . DIRECTORY_SEPARATOR . $fileName)) {
152
+            if (is_file($path.DIRECTORY_SEPARATOR.$fileName)) {
153 153
                 return true;
154 154
             }
155 155
         }
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
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
     public function __construct($reader, $paths = null)
80 80
     {
81 81
         $this->reader = $reader;
82
-        if (! $paths) {
82
+        if (!$paths) {
83 83
             return;
84 84
         }
85 85
 
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
             return $this->classNames;
193 193
         }
194 194
 
195
-        if (! $this->paths) {
195
+        if (!$this->paths) {
196 196
             throw MappingException::pathRequired();
197 197
         }
198 198
 
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
         $includedFiles = [];
201 201
 
202 202
         foreach ($this->paths as $path) {
203
-            if (! is_dir($path)) {
203
+            if (!is_dir($path)) {
204 204
                 throw MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path);
205 205
             }
206 206
 
@@ -209,14 +209,14 @@  discard block
 block discarded – undo
209 209
                     new RecursiveDirectoryIterator($path, FilesystemIterator::SKIP_DOTS),
210 210
                     RecursiveIteratorIterator::LEAVES_ONLY
211 211
                 ),
212
-                '/^.+' . preg_quote($this->fileExtension) . '$/i',
212
+                '/^.+'.preg_quote($this->fileExtension).'$/i',
213 213
                 RecursiveRegexIterator::GET_MATCH
214 214
             );
215 215
 
216 216
             foreach ($iterator as $file) {
217 217
                 $sourceFile = $file[0];
218 218
 
219
-                if (! preg_match('(^phar:)i', $sourceFile)) {
219
+                if (!preg_match('(^phar:)i', $sourceFile)) {
220 220
                     $sourceFile = realpath($sourceFile);
221 221
                 }
222 222
 
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
         foreach ($declared as $className) {
241 241
             $rc         = new ReflectionClass($className);
242 242
             $sourceFile = $rc->getFileName();
243
-            if (! in_array($sourceFile, $includedFiles) || $this->isTransient($className)) {
243
+            if (!in_array($sourceFile, $includedFiles) || $this->isTransient($className)) {
244 244
                 continue;
245 245
             }
246 246
 
Please login to merge, or discard this patch.
lib/Doctrine/Persistence/Mapping/Driver/FileDriver.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -90,8 +90,8 @@  discard block
 block discarded – undo
90 90
         }
91 91
 
92 92
         $result = $this->loadMappingFile($this->locator->findMappingFile($className));
93
-        if (! isset($result[$className])) {
94
-            throw MappingException::invalidMappingFile($className, str_replace('\\', '.', $className) . $this->locator->getFileExtension());
93
+        if (!isset($result[$className])) {
94
+            throw MappingException::invalidMappingFile($className, str_replace('\\', '.', $className).$this->locator->getFileExtension());
95 95
         }
96 96
 
97 97
         $this->classCache[$className] = $result[$className];
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
             return false;
113 113
         }
114 114
 
115
-        return ! $this->locator->fileExists($className);
115
+        return !$this->locator->fileExists($className);
116 116
     }
117 117
 
118 118
     /**
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
             $this->initialize();
125 125
         }
126 126
 
127
-        if (! $this->classCache) {
127
+        if (!$this->classCache) {
128 128
             return (array) $this->locator->getAllClassNames($this->globalBasename);
129 129
         }
130 130
 
@@ -163,8 +163,8 @@  discard block
 block discarded – undo
163 163
         }
164 164
 
165 165
         foreach ($this->locator->getPaths() as $path) {
166
-            $file = $path . '/' . $this->globalBasename . $this->locator->getFileExtension();
167
-            if (! is_file($file)) {
166
+            $file = $path.'/'.$this->globalBasename.$this->locator->getFileExtension();
167
+            if (!is_file($file)) {
168 168
                 continue;
169 169
             }
170 170
 
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
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
         ));
Please login to merge, or discard this patch.
lib/Doctrine/Persistence/Event/PreUpdateEventArgs.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -102,7 +102,7 @@
 block discarded – undo
102 102
      */
103 103
     private function assertValidField($field)
104 104
     {
105
-        if (! isset($this->entityChangeSet[$field])) {
105
+        if (!isset($this->entityChangeSet[$field])) {
106 106
             throw new InvalidArgumentException(sprintf(
107 107
                 'Field "%s" is not a valid field of the entity "%s" in PreUpdateEventArgs.',
108 108
                 $field,
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
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
             $name = $this->defaultConnection;
91 91
         }
92 92
 
93
-        if (! isset($this->connections[$name])) {
93
+        if (!isset($this->connections[$name])) {
94 94
             throw new InvalidArgumentException(sprintf('Doctrine %s Connection named "%s" does not exist.', $this->name, $name));
95 95
         }
96 96
 
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
             $name = $this->defaultManager;
146 146
         }
147 147
 
148
-        if (! isset($this->managers[$name])) {
148
+        if (!isset($this->managers[$name])) {
149 149
             throw new InvalidArgumentException(sprintf('Doctrine %s Manager named "%s" does not exist.', $this->name, $name));
150 150
         }
151 151
 
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
         // Check for namespace alias
161 161
         if (strpos($class, ':') !== false) {
162 162
             [$namespaceAlias, $simpleClassName] = explode(':', $class, 2);
163
-            $class                              = $this->getAliasNamespace($namespaceAlias) . '\\' . $simpleClassName;
163
+            $class                              = $this->getAliasNamespace($namespaceAlias).'\\'.$simpleClassName;
164 164
         }
165 165
 
166 166
         $proxyClass = new ReflectionClass($class);
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
         if ($proxyClass->implementsInterface($this->proxyInterfaceName)) {
169 169
             $parentClass = $proxyClass->getParentClass();
170 170
 
171
-            if (! $parentClass) {
171
+            if (!$parentClass) {
172 172
                 return null;
173 173
             }
174 174
 
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
         foreach ($this->managers as $id) {
179 179
             $manager = $this->getService($id);
180 180
 
181
-            if (! $manager->getMetadataFactory()->isTransient($class)) {
181
+            if (!$manager->getMetadataFactory()->isTransient($class)) {
182 182
                 return $manager;
183 183
             }
184 184
         }
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
             $name = $this->defaultManager;
223 223
         }
224 224
 
225
-        if (! isset($this->managers[$name])) {
225
+        if (!isset($this->managers[$name])) {
226 226
             throw new InvalidArgumentException(sprintf('Doctrine %s Manager named "%s" does not exist.', $this->name, $name));
227 227
         }
228 228
 
Please login to merge, or discard this patch.
Doctrine/Tests/Common/Persistence/Mapping/ClassMetadataFactoryTest.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
111 111
     {
112 112
         $classMetadata = $this->createMock(ClassMetadata::class);
113 113
 
114
-        $this->cmf->fallbackCallback = static function () use ($classMetadata) {
114
+        $this->cmf->fallbackCallback = static function() use ($classMetadata) {
115 115
             return $classMetadata;
116 116
         };
117 117
 
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 
123 123
     public function testWillFailOnFallbackFailureWithNotLoadedMetadata()
124 124
     {
125
-        $this->cmf->fallbackCallback = static function () {
125
+        $this->cmf->fallbackCallback = static function() {
126 126
             return null;
127 127
         };
128 128
 
Please login to merge, or discard this patch.