Completed
Pull Request — master (#7413)
by Michael
10:40
created
lib/Doctrine/ORM/Tools/Console/Command/MappingDescribeCommand.php 2 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -51,9 +51,9 @@  discard block
 block discarded – undo
51 51
     protected function configure()
52 52
     {
53 53
         $this->setName('orm:mapping:describe')
54
-             ->addArgument('entityName', InputArgument::REQUIRED, 'Full or partial name of entity')
55
-             ->setDescription('Display information about mapped objects')
56
-             ->setHelp(<<<'EOT'
54
+                ->addArgument('entityName', InputArgument::REQUIRED, 'Full or partial name of entity')
55
+                ->setDescription('Display information about mapped objects')
56
+                ->setHelp(<<<'EOT'
57 57
 The %command.full_name% command describes the metadata for the given full or partial entity class name.
58 58
 
59 59
     <info>%command.full_name%</info> My\Namespace\Entity\MyEntity
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 
63 63
     <info>%command.full_name%</info> MyEntity
64 64
 EOT
65
-             );
65
+                );
66 66
     }
67 67
 
68 68
     /**
@@ -139,8 +139,8 @@  discard block
 block discarded – undo
139 139
     private function getMappedEntities(EntityManagerInterface $entityManager)
140 140
     {
141 141
         $entityClassNames = $entityManager->getConfiguration()
142
-                                          ->getMetadataDriverImpl()
143
-                                          ->getAllClassNames();
142
+                                            ->getMetadataDriverImpl()
143
+                                            ->getAllClassNames();
144 144
 
145 145
         if (! $entityClassNames) {
146 146
             throw new InvalidArgumentException(
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -142,9 +142,9 @@  discard block
 block discarded – undo
142 142
                                           ->getMetadataDriverImpl()
143 143
                                           ->getAllClassNames();
144 144
 
145
-        if (! $entityClassNames) {
145
+        if ( ! $entityClassNames) {
146 146
             throw new InvalidArgumentException(
147
-                'You do not have any mapped Doctrine ORM entities according to the current configuration. ' .
147
+                'You do not have any mapped Doctrine ORM entities according to the current configuration. '.
148 148
                 'If you have entities or mapping files you should check your mapping configuration for errors.'
149 149
             );
150 150
         }
@@ -169,12 +169,12 @@  discard block
 block discarded – undo
169 169
 
170 170
         $matches = array_filter(
171 171
             $this->getMappedEntities($entityManager),
172
-            static function ($mappedEntity) use ($entityName) {
173
-                return preg_match('{' . preg_quote($entityName) . '}', $mappedEntity);
172
+            static function($mappedEntity) use ($entityName) {
173
+                return preg_match('{'.preg_quote($entityName).'}', $mappedEntity);
174 174
             }
175 175
         );
176 176
 
177
-        if (! $matches) {
177
+        if ( ! $matches) {
178 178
             throw new InvalidArgumentException(sprintf(
179 179
                 'Could not find any mapped Entity classes matching "%s"',
180 180
                 $entityName
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
 
227 227
             $output[] = $this->formatField(
228 228
                 sprintf('  %s', $parentClass->getParent()),
229
-                ($parentClass->isRootEntity() ? '(Root) ' : '') . $this->formatValue($attributes)
229
+                ($parentClass->isRootEntity() ? '(Root) ' : '').$this->formatValue($attributes)
230 230
             );
231 231
         }
232 232
 
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
         }
252 252
 
253 253
         if (is_bool($value)) {
254
-            return '<comment>' . ($value ? 'True' : 'False') . '</comment>';
254
+            return '<comment>'.($value ? 'True' : 'False').'</comment>';
255 255
         }
256 256
 
257 257
         if (empty($value)) {
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Tools/Console/Command/GenerateProxiesCommand.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -57,19 +57,19 @@
 block discarded – undo
57 57
             $destPath = $em->getConfiguration()->getProxyDir();
58 58
         }
59 59
 
60
-        if (! is_dir($destPath)) {
60
+        if ( ! is_dir($destPath)) {
61 61
             mkdir($destPath, 0775, true);
62 62
         }
63 63
 
64 64
         $destPath = realpath($destPath);
65 65
 
66
-        if (! file_exists($destPath)) {
66
+        if ( ! file_exists($destPath)) {
67 67
             throw new InvalidArgumentException(
68 68
                 sprintf("Proxies destination directory '<info>%s</info>' does not exist.", $em->getConfiguration()->getProxyDir())
69 69
             );
70 70
         }
71 71
 
72
-        if (! is_writable($destPath)) {
72
+        if ( ! is_writable($destPath)) {
73 73
             throw new InvalidArgumentException(
74 74
                 sprintf("Proxies destination directory '<info>%s</info>' does not have write permissions.", $destPath)
75 75
             );
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Tools/Console/Command/RunDqlCommand.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -59,14 +59,14 @@  discard block
 block discarded – undo
59 59
 
60 60
         $depth = $input->getOption('depth');
61 61
 
62
-        if (! is_numeric($depth)) {
62
+        if ( ! is_numeric($depth)) {
63 63
             throw new LogicException("Option 'depth' must contain an integer value");
64 64
         }
65 65
 
66 66
         $hydrationModeName = $input->getOption('hydrate');
67
-        $hydrationMode     = 'Doctrine\ORM\Query::HYDRATE_' . strtoupper(str_replace('-', '_', $hydrationModeName));
67
+        $hydrationMode     = 'Doctrine\ORM\Query::HYDRATE_'.strtoupper(str_replace('-', '_', $hydrationModeName));
68 68
 
69
-        if (! defined($hydrationMode)) {
69
+        if ( ! defined($hydrationMode)) {
70 70
             throw new RuntimeException(sprintf(
71 71
                 "Hydration mode '%s' does not exist. It should be either: object. array, scalar or single-scalar.",
72 72
                 $hydrationModeName
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
         $firstResult = $input->getOption('first-result');
78 78
 
79 79
         if ($firstResult !== null) {
80
-            if (! is_numeric($firstResult)) {
80
+            if ( ! is_numeric($firstResult)) {
81 81
                 throw new LogicException("Option 'first-result' must contain an integer value");
82 82
             }
83 83
 
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
         $maxResult = $input->getOption('max-result');
88 88
 
89 89
         if ($maxResult !== null) {
90
-            if (! is_numeric($maxResult)) {
90
+            if ( ! is_numeric($maxResult)) {
91 91
                 throw new LogicException("Option 'max-result' must contain an integer value");
92 92
             }
93 93
 
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Tools/Console/Command/ClearCache/EntityRegionCommand.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -73,18 +73,18 @@
 block discarded – undo
73 73
         $entityId    = $input->getArgument('entity-id');
74 74
         $cache       = $em->getCache();
75 75
 
76
-        if (! $cache instanceof Cache) {
76
+        if ( ! $cache instanceof Cache) {
77 77
             throw new InvalidArgumentException('No second-level cache is configured on the given EntityManager.');
78 78
         }
79 79
 
80
-        if (! $entityClass && ! $input->getOption('all')) {
80
+        if ( ! $entityClass && ! $input->getOption('all')) {
81 81
             throw new InvalidArgumentException('Invalid argument "--entity-class"');
82 82
         }
83 83
 
84 84
         if ($input->getOption('flush')) {
85 85
             $entityRegion = $cache->getEntityCacheRegion($entityClass);
86 86
 
87
-            if (! $entityRegion instanceof DefaultRegion) {
87
+            if ( ! $entityRegion instanceof DefaultRegion) {
88 88
                 throw new InvalidArgumentException(sprintf(
89 89
                     'The option "--flush" expects a "Doctrine\ORM\Cache\Region\DefaultRegion", but got "%s".',
90 90
                     is_object($entityRegion) ? get_class($entityRegion) : gettype($entityRegion)
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Tools/Console/Command/ClearCache/QueryCommand.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
         $em          = $this->getHelper('em')->getEntityManager();
58 58
         $cacheDriver = $em->getConfiguration()->getQueryCacheImpl();
59 59
 
60
-        if (! $cacheDriver) {
60
+        if ( ! $cacheDriver) {
61 61
             throw new InvalidArgumentException('No Query cache driver is configured on given EntityManager.');
62 62
         }
63 63
 
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
             $message = $result ? 'Successfully flushed cache entries.' : $message;
79 79
         }
80 80
 
81
-        if (! $result) {
81
+        if ( ! $result) {
82 82
             $ui->error($message);
83 83
 
84 84
             return 1;
Please login to merge, or discard this patch.
Doctrine/ORM/Tools/Console/Command/ClearCache/CollectionRegionCommand.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
         $ownerId    = $input->getArgument('owner-id');
76 76
         $cache      = $em->getCache();
77 77
 
78
-        if (! $cache instanceof Cache) {
78
+        if ( ! $cache instanceof Cache) {
79 79
             throw new InvalidArgumentException('No second-level cache is configured on the given EntityManager.');
80 80
         }
81 81
 
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
         if ($input->getOption('flush')) {
87 87
             $collectionRegion = $cache->getCollectionCacheRegion($ownerClass, $assoc);
88 88
 
89
-            if (! $collectionRegion instanceof DefaultRegion) {
89
+            if ( ! $collectionRegion instanceof DefaultRegion) {
90 90
                 throw new InvalidArgumentException(sprintf(
91 91
                     'The option "--flush" expects a "Doctrine\ORM\Cache\Region\DefaultRegion", but got "%s".',
92 92
                     is_object($collectionRegion) ? get_class($collectionRegion) : gettype($collectionRegion)
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Tools/Console/Command/ClearCache/MetadataCommand.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
         $em          = $this->getHelper('em')->getEntityManager();
58 58
         $cacheDriver = $em->getConfiguration()->getMetadataCacheImpl();
59 59
 
60
-        if (! $cacheDriver) {
60
+        if ( ! $cacheDriver) {
61 61
             throw new InvalidArgumentException('No Metadata cache driver is configured on given EntityManager.');
62 62
         }
63 63
 
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
             $message = $result ? 'Successfully flushed cache entries.' : $message;
80 80
         }
81 81
 
82
-        if (! $result) {
82
+        if ( ! $result) {
83 83
             $ui->error($message);
84 84
 
85 85
             return 1;
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Tools/Console/Command/ClearCache/ResultCommand.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
         $em          = $this->getHelper('em')->getEntityManager();
58 58
         $cacheDriver = $em->getConfiguration()->getResultCacheImpl();
59 59
 
60
-        if (! $cacheDriver) {
60
+        if ( ! $cacheDriver) {
61 61
             throw new InvalidArgumentException('No Result cache driver is configured on given EntityManager.');
62 62
         }
63 63
 
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
             $message = $result ? 'Successfully flushed cache entries.' : $message;
80 80
         }
81 81
 
82
-        if (! $result) {
82
+        if ( ! $result) {
83 83
             $ui->error($message);
84 84
 
85 85
             return 1;
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Tools/Console/Command/ClearCache/QueryRegionCommand.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
             $name = Cache::DEFAULT_QUERY_REGION_NAME;
76 76
         }
77 77
 
78
-        if (! $cache instanceof Cache) {
78
+        if ( ! $cache instanceof Cache) {
79 79
             throw new InvalidArgumentException('No second-level cache is configured on the given EntityManager.');
80 80
         }
81 81
 
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
             $queryCache  = $cache->getQueryCache($name);
84 84
             $queryRegion = $queryCache->getRegion();
85 85
 
86
-            if (! $queryRegion instanceof DefaultRegion) {
86
+            if ( ! $queryRegion instanceof DefaultRegion) {
87 87
                 throw new InvalidArgumentException(sprintf(
88 88
                     'The option "--flush" expects a "Doctrine\ORM\Cache\Region\DefaultRegion", but got "%s".',
89 89
                     is_object($queryRegion) ? get_class($queryRegion) : gettype($queryRegion)
Please login to merge, or discard this patch.