Completed
Pull Request — master (#135)
by Alex
07:30 queued 01:34
created
Core/Executor/ContentManager.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -648,7 +648,7 @@
 block discarded – undo
648 648
      * @param string $contentTypeIdentifier
649 649
      * @param array $context
650 650
      * @throws \InvalidArgumentException
651
-     * @return mixed
651
+     * @return \Kaliop\eZMigrationBundle\API\Value\MigrationStep
652 652
      */
653 653
     protected function getFieldValue($value, FieldDefinition $fieldDefinition, $contentTypeIdentifier, array $context = array())
654 654
     {
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -439,7 +439,7 @@  discard block
 block discarded – undo
439 439
                         $hashValue = $this->fieldHandlerManager->fieldValueToHash(
440 440
                             $fieldDefinition->fieldTypeIdentifier, $contentType->identifier, $field->value
441 441
                         );
442
-                        if (is_array($hashValue) ) {
442
+                        if (is_array($hashValue)) {
443 443
                             if (count($parts) == 2 && $fieldIdentifier === $parts[1]) {
444 444
                                 throw new \InvalidArgumentException('Content Manager does not support setting references for attribute ' . $reference['attribute'] . ': the given attribute has an array value');
445 445
                             }
@@ -515,7 +515,7 @@  discard block
 block discarded – undo
515 515
                     $locations = $locationService->loadLocations($content->contentInfo);
516 516
                     if (count($locations) > 1) {
517 517
                         $otherParentLocations = array();
518
-                        foreach($locations as $otherLocation) {
518
+                        foreach ($locations as $otherLocation) {
519 519
                             if ($otherLocation->id != $location->id) {
520 520
                                 $otherParentLocations[] = $otherLocation->parentLocationId;
521 521
                             }
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,6 @@
 block discarded – undo
4 4
 
5 5
 use eZ\Publish\API\Repository\Values\ContentType\ContentType;
6 6
 use eZ\Publish\API\Repository\Values\ContentType\FieldDefinition;
7
-use eZ\Publish\API\Repository\Values\Content\Location;
8 7
 use eZ\Publish\API\Repository\Values\Content\Content;
9 8
 use eZ\Publish\API\Repository\Values\Content\ContentCreateStruct;
10 9
 use eZ\Publish\API\Repository\Values\Content\ContentUpdateStruct;
Please login to merge, or discard this patch.
Core/Executor/MigrationExecutor.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
     /**
51 51
      * @param array $dsl
52 52
      * @param array $context
53
-     * @return true
53
+     * @return boolean
54 54
      * @throws \Exception
55 55
      */
56 56
     protected function cancel($dsl, $context)
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
     /**
71 71
      * @param array $dsl
72 72
      * @param array $context
73
-     * @return true
73
+     * @return boolean
74 74
      * @throws \Exception
75 75
      */
76 76
     protected function suspend($dsl, $context)
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -105,13 +105,13 @@  discard block
 block discarded – undo
105 105
         $dsl['mode'] = 'load';
106 106
         // be kind to users and allow them not to specify this explicitly
107 107
         if (isset($dsl['references'])) {
108
-            foreach($dsl['references'] as &$refDef) {
108
+            foreach ($dsl['references'] as &$refDef) {
109 109
                 $refDef['overwrite'] = true;
110 110
             }
111 111
         }
112 112
         $step = new MigrationStep($dsl['type'], $dsl, $context);
113 113
 
114
-        switch($dsl['type']) {
114
+        switch ($dsl['type']) {
115 115
             case 'content':
116 116
                 return $this->contentManager->execute($step);
117 117
             case 'location':
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
                     return $this->matchConditions($values);
140 140
 
141 141
                 default:
142
-                    throw new \Exception("Unknown until condition: '$key' when suspending a migration ".var_export($conditions, true));
142
+                    throw new \Exception("Unknown until condition: '$key' when suspending a migration " . var_export($conditions, true));
143 143
             }
144 144
         }
145 145
     }
Please login to merge, or discard this patch.
Core/FieldHandler/EzSelection.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 
36 36
         // allow user to pass in selection values by name
37 37
         $fieldSettings = null;
38
-        foreach($fieldValue as $key => $val) {
38
+        foreach ($fieldValue as $key => $val) {
39 39
             if (is_string($val)) {
40 40
                 if (ctype_digit($val)) {
41 41
                     $fieldValue[$key] = (int)$val;
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
                     if ($fieldSettings === null) {
44 44
                         $fieldSettings = $this->loadFieldSettings($context['contentTypeIdentifier'], $context['fieldIdentifier']);
45 45
                     }
46
-                    foreach($fieldSettings['options'] as $pos => $name) {
46
+                    foreach ($fieldSettings['options'] as $pos => $name) {
47 47
                         if ($name === $val) {
48 48
                             $fieldValue[$key] = $pos;
49 49
                             break;
Please login to merge, or discard this patch.
Core/FieldHandler/FileFieldHandler.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
     protected $ioRootDir;
12 12
     protected $ioDecorator;
13 13
 
14
-    public function __construct($ioRootDir, UrlDecorator $ioDecorator=null)
14
+    public function __construct($ioRootDir, UrlDecorator $ioDecorator = null)
15 15
     {
16 16
         $this->ioRootDir = $ioRootDir;
17 17
         $this->ioDecorator = $ioDecorator;
Please login to merge, or discard this patch.
Core/Executor/ReferenceExecutor.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -133,7 +133,7 @@
 block discarded – undo
133 133
             throw new \Exception("Invalid step definition: file '$fileName' for saving references already exists");
134 134
         }
135 135
 
136
-        if (! $this->referenceResolver instanceof EnumerableReferenceResolverInterface) {
136
+        if (!$this->referenceResolver instanceof EnumerableReferenceResolverInterface) {
137 137
             throw new \Exception("Can not save references as resolver is not enumerable");
138 138
         }
139 139
 
Please login to merge, or discard this patch.
Core/ReferenceResolver/ChainResolver.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -98,7 +98,7 @@
 block discarded – undo
98 98
         $refs = array();
99 99
 
100 100
         foreach ($this->resolvers as $resolver) {
101
-            if (! $resolver instanceof EnumerableReferenceResolverInterface) {
101
+            if (!$resolver instanceof EnumerableReferenceResolverInterface) {
102 102
                 throw new \Exception("Could not enumerate references because of chained resolver of type: " . get_class($resolver));
103 103
             }
104 104
 
Please login to merge, or discard this patch.
Core/Matcher/ReferenceMatcher.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 
82 82
             switch ($key) {
83 83
                 case self::MATCH_AND:
84
-                    foreach($values as $subCriterion) {
84
+                    foreach ($values as $subCriterion) {
85 85
                         $value = $this->match($subCriterion);
86 86
                         if (!reset($value)) {
87 87
                             return $value;
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
                     return array(true);
91 91
 
92 92
                 case self::MATCH_OR:
93
-                    foreach($values as $subCriterion) {
93
+                    foreach ($values as $subCriterion) {
94 94
                         $value = $this->match($subCriterion);
95 95
                         if (reset($value)) {
96 96
                             return $value;
Please login to merge, or discard this patch.
Core/Matcher/QueryBasedMatcher.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
                 return new Query\Criterion\DateMetadata(Query\Criterion\DateMetadata::CREATED, self::$operatorsMap[$operator], $match);
129 129
 
130 130
             case self::MATCH_GROUP:
131
-                foreach($values as &$value) {
131
+                foreach ($values as &$value) {
132 132
                     if (!ctype_digit($value)) {
133 133
                         $value = $this->groupMatcher->matchOneByKey($value)->id;
134 134
                     }
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
                 return new Query\Criterion\DateMetadata(Query\Criterion\DateMetadata::MODIFIED, self::$operatorsMap[$operator], $match);
145 145
 
146 146
             case self::MATCH_OBJECT_STATE:
147
-                foreach($values as &$value) {
147
+                foreach ($values as &$value) {
148 148
                     if (!ctype_digit($value)) {
149 149
                         $value = $this->stateMatcher->matchOneByKey($value)->id;
150 150
                     }
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
                 return new Query\Criterion\ObjectStateId($values);
153 153
 
154 154
             case self::MATCH_OWNER:
155
-                foreach($values as &$value) {
155
+                foreach ($values as &$value) {
156 156
                     if (!ctype_digit($value)) {
157 157
                         $value = $this->userMatcher->matchOneByKey($value)->id;
158 158
                     }
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
                 return new Query\Criterion\ParentLocationId($locationIds);
173 173
 
174 174
             case self::MATCH_SECTION:
175
-                foreach($values as &$value) {
175
+                foreach ($values as &$value) {
176 176
                     if (!ctype_digit($value)) {
177 177
                         $value = $this->sectionMatcher->matchOneByKey($value)->id;
178 178
                     }
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
 
194 194
             case self::MATCH_AND:
195 195
                 $subCriteria = array();
196
-                foreach($values as $subCriterion) {
196
+                foreach ($values as $subCriterion) {
197 197
                     $value = reset($subCriterion);
198 198
                     $subCriteria[] = $this->getQueryCriterion(key($subCriterion), $value);
199 199
                 }
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
 
202 202
             case self::MATCH_OR:
203 203
                 $subCriteria = array();
204
-                foreach($values as $subCriterion) {
204
+                foreach ($values as $subCriterion) {
205 205
                     $value = reset($subCriterion);
206 206
                     $subCriteria[] = $this->getQueryCriterion(key($subCriterion), $value);
207 207
                 }
Please login to merge, or discard this patch.
Core/ContextHandler.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
     public function storeCurrentContext($migrationName)
36 36
     {
37 37
         $context = array();
38
-        foreach($this->providers as $label => $provider) {
38
+        foreach ($this->providers as $label => $provider) {
39 39
             $context[$label] = $provider->getCurrentContext($migrationName);
40 40
         }
41 41
 
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
         if (!is_array($context)) {
53 53
             throw new \Exception("No execution context found associated with migration '$migrationName'");
54 54
         }
55
-        foreach($this->providers as $label => $provider) {
55
+        foreach ($this->providers as $label => $provider) {
56 56
             if (isset($context[$label])) {
57 57
                 $provider->restoreContext($migrationName, $context[$label]);
58 58
             }
Please login to merge, or discard this patch.