Passed
Pull Request — 2.6 (#7444)
by
unknown
08:12
created
lib/Doctrine/ORM/Tools/Export/Driver/XmlExporter.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -41,9 +41,9 @@  discard block
 block discarded – undo
41 41
      */
42 42
     public function exportClassMetadata(ClassMetadataInfo $metadata)
43 43
     {
44
-        $xml = new SimpleXmlElement('<?xml version="1.0" encoding="utf-8"?><doctrine-mapping ' .
45
-            'xmlns="https://www.doctrine-project.org/schemas/orm/doctrine-mapping" ' .
46
-            'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ' .
44
+        $xml = new SimpleXmlElement('<?xml version="1.0" encoding="utf-8"?><doctrine-mapping '.
45
+            'xmlns="https://www.doctrine-project.org/schemas/orm/doctrine-mapping" '.
46
+            'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" '.
47 47
             'xsi:schemaLocation="https://www.doctrine-project.org/schemas/orm/doctrine-mapping https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd" />');
48 48
 
49 49
         if ($metadata->isMappedSuperclass) {
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 
99 99
         $trackingPolicy = $this->_getChangeTrackingPolicyString($metadata->changeTrackingPolicy);
100 100
 
101
-        if ( $trackingPolicy != 'DEFERRED_IMPLICIT') {
101
+        if ($trackingPolicy != 'DEFERRED_IMPLICIT') {
102 102
             $root->addChild('change-tracking-policy', $trackingPolicy);
103 103
         }
104 104
 
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
             }
298 298
 
299 299
             if (count($cascade) === 5) {
300
-                $cascade  = ['cascade-all'];
300
+                $cascade = ['cascade-all'];
301 301
             }
302 302
 
303 303
             if ($cascade) {
@@ -379,7 +379,7 @@  discard block
 block discarded – undo
379 379
             }
380 380
         }
381 381
 
382
-        if (isset($metadata->lifecycleCallbacks) && count($metadata->lifecycleCallbacks)>0) {
382
+        if (isset($metadata->lifecycleCallbacks) && count($metadata->lifecycleCallbacks) > 0) {
383 383
             $lifecycleCallbacksXml = $root->addChild('lifecycle-callbacks');
384 384
 
385 385
             foreach ($metadata->lifecycleCallbacks as $name => $methods) {
@@ -430,7 +430,7 @@  discard block
 block discarded – undo
430 430
     {
431 431
         $sequenceDefinition = $metadata->sequenceGeneratorDefinition;
432 432
 
433
-        if (! ($metadata->generatorType === ClassMetadataInfo::GENERATOR_TYPE_SEQUENCE && $sequenceDefinition)) {
433
+        if ( ! ($metadata->generatorType === ClassMetadataInfo::GENERATOR_TYPE_SEQUENCE && $sequenceDefinition)) {
434 434
             return;
435 435
         }
436 436
 
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Tools/Export/AbstractClassMetadataExporterTest.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
     {
42 42
         $driverMock = new DriverMock();
43 43
         $config = new Configuration();
44
-        $config->setProxyDir(__DIR__ . '/../../Proxies');
44
+        $config->setProxyDir(__DIR__.'/../../Proxies');
45 45
         $config->setProxyNamespace('Doctrine\Tests\Proxies');
46 46
         $eventManager = new EventManager();
47 47
         $conn = new ConnectionMock([], $driverMock, $config, $eventManager);
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
             'yaml'       => YamlDriver::class,
60 60
         ];
61 61
 
62
-        $this->assertArrayHasKey($type, $mappingDriver, "There is no metadata driver for the type '" . $type . "'.");
62
+        $this->assertArrayHasKey($type, $mappingDriver, "There is no metadata driver for the type '".$type."'.");
63 63
 
64 64
         $class  = $mappingDriver[$type];
65 65
         $driver = ($type === 'annotation')
@@ -82,10 +82,10 @@  discard block
 block discarded – undo
82 82
 
83 83
     public function testExportDirectoryAndFilesAreCreated()
84 84
     {
85
-        $this->_deleteDirectory(__DIR__ . '/export/'.$this->_getType());
85
+        $this->_deleteDirectory(__DIR__.'/export/'.$this->_getType());
86 86
 
87 87
         $type = $this->_getType();
88
-        $metadataDriver = $this->_createMetadataDriver($type, __DIR__ . '/' . $type);
88
+        $metadataDriver = $this->_createMetadataDriver($type, __DIR__.'/'.$type);
89 89
         $em = $this->_createEntityManager($metadataDriver);
90 90
         $cmf = $this->_createClassMetadataFactory($em, $type);
91 91
         $metadata = $cmf->getAllMetadata();
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 
97 97
         $type = $this->_getType();
98 98
         $cme = new ClassMetadataExporter();
99
-        $exporter = $cme->getExporter($type, __DIR__ . '/export/' . $type);
99
+        $exporter = $cme->getExporter($type, __DIR__.'/export/'.$type);
100 100
 
101 101
         if ($type === 'annotation') {
102 102
             $entityGenerator = new EntityGenerator();
@@ -111,9 +111,9 @@  discard block
 block discarded – undo
111 111
         $exporter->export();
112 112
 
113 113
         if ($type == 'annotation') {
114
-            $this->assertTrue(file_exists(__DIR__ . '/export/' . $type . '/'.str_replace('\\', '/', ExportedUser::class).$this->_extension));
114
+            $this->assertTrue(file_exists(__DIR__.'/export/'.$type.'/'.str_replace('\\', '/', ExportedUser::class).$this->_extension));
115 115
         } else {
116
-            $this->assertTrue(file_exists(__DIR__ . '/export/' . $type . '/Doctrine.Tests.ORM.Tools.Export.ExportedUser'.$this->_extension));
116
+            $this->assertTrue(file_exists(__DIR__.'/export/'.$type.'/Doctrine.Tests.ORM.Tools.Export.ExportedUser'.$this->_extension));
117 117
         }
118 118
     }
119 119
 
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
     {
125 125
         $type = $this->_getType();
126 126
 
127
-        $metadataDriver = $this->_createMetadataDriver($type, __DIR__ . '/export/' . $type);
127
+        $metadataDriver = $this->_createMetadataDriver($type, __DIR__.'/export/'.$type);
128 128
         $em = $this->_createEntityManager($metadataDriver);
129 129
         $cmf = $this->_createClassMetadataFactory($em, $type);
130 130
         $metadata = $cmf->getAllMetadata();
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
         $type = $this->_getType();
211 211
 
212 212
         if ($type == 'xml') {
213
-            $xml = simplexml_load_file(__DIR__ . '/export/'.$type.'/Doctrine.Tests.ORM.Tools.Export.ExportedUser.dcm.xml');
213
+            $xml = simplexml_load_file(__DIR__.'/export/'.$type.'/Doctrine.Tests.ORM.Tools.Export.ExportedUser.dcm.xml');
214 214
 
215 215
             $xml->registerXPathNamespace("d", "https://www.doctrine-project.org/schemas/orm/doctrine-mapping");
216 216
             $nodes = $xml->xpath("/d:doctrine-mapping/d:entity/d:field[@name='name' and @type='string' and @nullable='true']");
@@ -354,7 +354,7 @@  discard block
 block discarded – undo
354 354
         $type = $this->_getType();
355 355
 
356 356
         if ($type == 'xml') {
357
-            $xml = simplexml_load_file(__DIR__ . '/export/'.$type.'/Doctrine.Tests.ORM.Tools.Export.ExportedUser.dcm.xml');
357
+            $xml = simplexml_load_file(__DIR__.'/export/'.$type.'/Doctrine.Tests.ORM.Tools.Export.ExportedUser.dcm.xml');
358 358
 
359 359
             $xml->registerXPathNamespace("d", "https://www.doctrine-project.org/schemas/orm/doctrine-mapping");
360 360
             $nodes = $xml->xpath("/d:doctrine-mapping/d:entity/d:one-to-many[@field='interests']/d:cascade/d:*");
@@ -363,7 +363,7 @@  discard block
 block discarded – undo
363 363
             $this->assertEquals('cascade-all', $nodes[0]->getName());
364 364
         } else if ($type == 'yaml') {
365 365
             $yaml = new Parser();
366
-            $value = $yaml->parse(file_get_contents(__DIR__ . '/export/'.$type.'/Doctrine.Tests.ORM.Tools.Export.ExportedUser.dcm.yml'));
366
+            $value = $yaml->parse(file_get_contents(__DIR__.'/export/'.$type.'/Doctrine.Tests.ORM.Tools.Export.ExportedUser.dcm.yml'));
367 367
 
368 368
             $this->assertTrue(isset($value[ExportedUser::class]['oneToMany']['interests']['cascade']));
369 369
             $this->assertEquals(1, count($value[ExportedUser::class]['oneToMany']['interests']['cascade']));
@@ -403,10 +403,10 @@  discard block
 block discarded – undo
403 403
         if (is_file($path)) {
404 404
             return unlink($path);
405 405
         } else if (is_dir($path)) {
406
-            $files = glob(rtrim($path,'/').'/*');
406
+            $files = glob(rtrim($path, '/').'/*');
407 407
 
408 408
             if (is_array($files)) {
409
-                foreach ($files as $file){
409
+                foreach ($files as $file) {
410 410
                     $this->_deleteDirectory($file);
411 411
                 }
412 412
             }
Please login to merge, or discard this patch.