Passed
Push — remove-persistent-object ( 44e379...355b1f )
by Jonathan
02:13
created
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.
tests/Doctrine/Tests/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.
tests/Doctrine/Tests/Persistence/Mapping/ClassMetadataFactoryTest.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
     public function testGetMetadataForAbsentClass()
48 48
     {
49 49
         $this->expectException(MappingException::class);
50
-        $this->cmf->getMetadataFor(__NAMESPACE__ . '\AbsentClass');
50
+        $this->cmf->getMetadataFor(__NAMESPACE__.'\AbsentClass');
51 51
     }
52 52
 
53 53
     public function testGetParentMetadata()
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
     {
64 64
         $metadata = $this->createMock(ClassMetadata::class);
65 65
         $cache    = new ArrayCache();
66
-        $cache->save(ChildEntity::class . '$CLASSMETADATA', $metadata);
66
+        $cache->save(ChildEntity::class.'$CLASSMETADATA', $metadata);
67 67
 
68 68
         $this->cmf->setCacheDriver($cache);
69 69
 
@@ -77,14 +77,14 @@  discard block
 block discarded – undo
77 77
 
78 78
         $loadedMetadata = $this->cmf->getMetadataFor(ChildEntity::class);
79 79
 
80
-        self::assertSame($loadedMetadata, $cache->fetch(ChildEntity::class . '$CLASSMETADATA'));
80
+        self::assertSame($loadedMetadata, $cache->fetch(ChildEntity::class.'$CLASSMETADATA'));
81 81
     }
82 82
 
83 83
     public function testGetAliasedMetadata()
84 84
     {
85 85
         $this->cmf->getMetadataFor('prefix:ChildEntity');
86 86
 
87
-        self::assertTrue($this->cmf->hasMetadataFor(__NAMESPACE__ . '\ChildEntity'));
87
+        self::assertTrue($this->cmf->hasMetadataFor(__NAMESPACE__.'\ChildEntity'));
88 88
         self::assertTrue($this->cmf->hasMetadataFor('prefix:ChildEntity'));
89 89
     }
90 90
 
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
     {
114 114
         $classMetadata = $this->createMock(ClassMetadata::class);
115 115
 
116
-        $this->cmf->fallbackCallback = static function () use ($classMetadata) {
116
+        $this->cmf->fallbackCallback = static function() use ($classMetadata) {
117 117
             return $classMetadata;
118 118
         };
119 119
 
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
 
125 125
     public function testWillFailOnFallbackFailureWithNotLoadedMetadata()
126 126
     {
127
-        $this->cmf->fallbackCallback = static function () {
127
+        $this->cmf->fallbackCallback = static function() {
128 128
             return null;
129 129
         };
130 130
 
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 
188 188
     protected function getFqcnFromAlias($namespaceAlias, $simpleClassName)
189 189
     {
190
-        return __NAMESPACE__ . '\\' . $simpleClassName;
190
+        return __NAMESPACE__.'\\'.$simpleClassName;
191 191
     }
192 192
 
193 193
     protected function initialize()
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
 
219 219
     protected function onNotFoundMetadata($className)
220 220
     {
221
-        if (! $this->fallbackCallback) {
221
+        if (!$this->fallbackCallback) {
222 222
             return null;
223 223
         }
224 224
 
Please login to merge, or discard this patch.
tests/Doctrine/Tests/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.
tests/Doctrine/Tests/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/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.
tests/Doctrine/Tests/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/Persistence/Mapping/SymfonyFileLocatorTest.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 {
14 14
     public function testGetPaths()
15 15
     {
16
-        $path   = __DIR__ . '/_files';
16
+        $path   = __DIR__.'/_files';
17 17
         $prefix = 'Foo';
18 18
 
19 19
         $locator = new SymfonyFileLocator([$path => $prefix]);
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 
26 26
     public function testGetPrefixes()
27 27
     {
28
-        $path   = __DIR__ . '/_files';
28
+        $path   = __DIR__.'/_files';
29 29
         $prefix = 'Foo';
30 30
 
31 31
         $locator = new SymfonyFileLocator([$path => $prefix]);
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 
43 43
     public function testFileExists()
44 44
     {
45
-        $path   = __DIR__ . '/_files';
45
+        $path   = __DIR__.'/_files';
46 46
         $prefix = 'Foo';
47 47
 
48 48
         $locator = new SymfonyFileLocator([$path => $prefix], '.yml');
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 
56 56
     public function testGetAllClassNames()
57 57
     {
58
-        $path   = __DIR__ . '/_files';
58
+        $path   = __DIR__.'/_files';
59 59
         $prefix = 'Foo';
60 60
 
61 61
         $locator       = new SymfonyFileLocator([$path => $prefix], '.yml');
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
      */
81 81
     public function testInvalidCustomNamespaceSeparator()
82 82
     {
83
-        $path   = __DIR__ . '/_files';
83
+        $path   = __DIR__.'/_files';
84 84
         $prefix = 'Foo';
85 85
 
86 86
         new SymfonyFileLocator([$path => $prefix], '.yml', null);
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
      */
105 105
     public function testGetClassNamesWithCustomNsSeparator($separator, $dir)
106 106
     {
107
-        $path   = __DIR__ . $dir;
107
+        $path   = __DIR__.$dir;
108 108
         $prefix = 'Foo';
109 109
 
110 110
         $locator = new SymfonyFileLocator([$path => $prefix], '.yml', $separator);
@@ -147,30 +147,30 @@  discard block
 block discarded – undo
147 147
      */
148 148
     public function testFindMappingFileWithCustomNsSeparator($separator, $dir, $files)
149 149
     {
150
-        $path   = __DIR__ . $dir;
150
+        $path   = __DIR__.$dir;
151 151
         $prefix = 'Foo';
152 152
 
153 153
         $locator = new SymfonyFileLocator([$path => $prefix], '.yml', $separator);
154 154
 
155 155
         foreach ($files as $filePath => $className) {
156
-            self::assertSame(realpath($path . '/' . $filePath), realpath($locator->findMappingFile($className)));
156
+            self::assertSame(realpath($path.'/'.$filePath), realpath($locator->findMappingFile($className)));
157 157
         }
158 158
     }
159 159
 
160 160
 
161 161
     public function testFindMappingFile()
162 162
     {
163
-        $path   = __DIR__ . '/_files';
163
+        $path   = __DIR__.'/_files';
164 164
         $prefix = 'Foo';
165 165
 
166 166
         $locator = new SymfonyFileLocator([$path => $prefix], '.yml');
167 167
 
168
-        self::assertSame(__DIR__ . '/_files/stdClass.yml', $locator->findMappingFile('Foo\\stdClass'));
168
+        self::assertSame(__DIR__.'/_files/stdClass.yml', $locator->findMappingFile('Foo\\stdClass'));
169 169
     }
170 170
 
171 171
     public function testFindMappingFileNotFound()
172 172
     {
173
-        $path   = __DIR__ . '/_files';
173
+        $path   = __DIR__.'/_files';
174 174
         $prefix = 'Foo';
175 175
 
176 176
         $locator = new SymfonyFileLocator([$path => $prefix], '.yml');
@@ -184,13 +184,13 @@  discard block
 block discarded – undo
184 184
     {
185 185
         // Low -> High
186 186
         $prefixes                             = [];
187
-        $prefixes[__DIR__ . '/_match_ns']     = 'Foo';
188
-        $prefixes[__DIR__ . '/_match_ns/Bar'] = 'Foo\\Bar';
187
+        $prefixes[__DIR__.'/_match_ns']     = 'Foo';
188
+        $prefixes[__DIR__.'/_match_ns/Bar'] = 'Foo\\Bar';
189 189
 
190 190
         $locator = new SymfonyFileLocator($prefixes, '.yml');
191 191
 
192 192
         self::assertSame(
193
-            __DIR__ . '/_match_ns/Bar/barEntity.yml',
193
+            __DIR__.'/_match_ns/Bar/barEntity.yml',
194 194
             $locator->findMappingFile("Foo\\Bar\\barEntity")
195 195
         );
196 196
     }
@@ -198,13 +198,13 @@  discard block
 block discarded – undo
198 198
     public function testFindMappingFileMostSpecificNamespaceFirst()
199 199
     {
200 200
         $prefixes                             = [];
201
-        $prefixes[__DIR__ . '/_match_ns/Bar'] = 'Foo\\Bar';
202
-        $prefixes[__DIR__ . '/_match_ns']     = 'Foo';
201
+        $prefixes[__DIR__.'/_match_ns/Bar'] = 'Foo\\Bar';
202
+        $prefixes[__DIR__.'/_match_ns']     = 'Foo';
203 203
 
204 204
         $locator = new SymfonyFileLocator($prefixes, '.yml');
205 205
 
206 206
         self::assertSame(
207
-            __DIR__ . '/_match_ns/Bar/barEntity.yml',
207
+            __DIR__.'/_match_ns/Bar/barEntity.yml',
208 208
             $locator->findMappingFile("Foo\\Bar\\barEntity")
209 209
         );
210 210
     }
Please login to merge, or discard this patch.