Completed
Push — master ( f932c1...98fbad )
by Gaetano
09:59
created
Core/ReferenceResolver/EmbeddedRegexpReferenceResolverTrait.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
     public function hasEmbeddedReferences($string)
19 19
     {
20 20
         $regexp = $this->getEmbeddedRegexp();
21
-        return (bool) preg_match_all($regexp, $string, $matches);
21
+        return (bool)preg_match_all($regexp, $string, $matches);
22 22
     }
23 23
     
24 24
     /**
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
     {
53 53
         // we need to alter the regexp we usr for std ref resolving, as it will be used to match parts of text, not the whole string
54 54
         $regexp = substr($this->getRegexp(), 1, -1);
55
-        return '/' . preg_quote($this->beginToken). preg_replace(array('/^\^/'), array(''), $regexp) . '[^' . $this->endToken . ']+' . preg_quote($this->endToken) . '/';
55
+        return '/' . preg_quote($this->beginToken) . preg_replace(array('/^\^/'), array(''), $regexp) . '[^' . $this->endToken . ']+' . preg_quote($this->endToken) . '/';
56 56
     }
57 57
 
58 58
     /**
Please login to merge, or discard this patch.
Core/FieldHandler/EzRichText.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
 {
12 12
     public function setReferenceResolver(ReferenceResolverInterface $referenceResolver)
13 13
     {
14
-        if (! $referenceResolver instanceof EmbeddedReferenceResolverInterface) {
14
+        if (!$referenceResolver instanceof EmbeddedReferenceResolverInterface) {
15 15
             throw new \Exception("Reference resolver injected into EzRichText field handler should implement EmbeddedReferenceResolverInterface");
16 16
         }
17 17
         parent::setReferenceResolver($referenceResolver);
Please login to merge, or discard this patch.
Core/FieldHandler/EzXmlText.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
 {
12 12
     public function setReferenceResolver(ReferenceResolverInterface $referenceResolver)
13 13
     {
14
-        if (! $referenceResolver instanceof EmbeddedReferenceResolverInterface) {
14
+        if (!$referenceResolver instanceof EmbeddedReferenceResolverInterface) {
15 15
             throw new \Exception("Reference resolver injected into EzXmlText field handler should implement EmbeddedReferenceResolverInterface");
16 16
         }
17 17
         parent::setReferenceResolver($referenceResolver);
Please login to merge, or discard this patch.
Command/TestBenchCommand.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,6 @@
 block discarded – undo
6 6
 use Kaliop\eZMigrationBundle\Core\MigrationService;
7 7
 use Symfony\Component\Console\Input\InputInterface;
8 8
 use Symfony\Component\Console\Output\OutputInterface;
9
-use Symfony\Component\Console\Input\InputOption;
10 9
 use Kaliop\eZMigrationBundle\API\Value\Migration;
11 10
 use Kaliop\eZMigrationBundle\API\Value\MigrationDefinition;
12 11
 
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 echo 'B';*/
50 50
 
51 51
         $ms->executeMigration(new MigrationDefinition(
52
-            'test_'.time(),
52
+            'test_' . time(),
53 53
             '/hello',
54 54
             '123',
55 55
             MigrationDefinition::STATUS_PARSED,
@@ -62,8 +62,8 @@  discard block
 block discarded – undo
62 62
 
63 63
         $sh = $this->getContainer()->get('ez_migration_bundle.storage_handler');
64 64
 
65
-        $m1 = 'hello_'.time();
66
-        $m2 = 'there_'.time();
65
+        $m1 = 'hello_' . time();
66
+        $m2 = 'there_' . time();
67 67
         $sh->startMigration(new MigrationDefinition(
68 68
             $m1,
69 69
             '/hello',
Please login to merge, or discard this patch.
Core/Executor/RepositoryExecutor.php 3 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
             }
226 226
         }
227 227
 
228
-        foreach($referencesDefs as $reference) {
228
+        foreach ($referencesDefs as $reference) {
229 229
             $overwrite = false;
230 230
             if (isset($reference['overwrite'])) {
231 231
                 $overwrite = $reference['overwrite'];
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
     {
247 247
         // allow setting *some* refs even when we have 0 or N matches
248 248
         foreach ($referencesDefinition as $key => $reference) {
249
-            switch($reference['attribute']) {
249
+            switch ($reference['attribute']) {
250 250
 
251 251
                 case 'count':
252 252
                     $value = count($entity);
Please login to merge, or discard this patch.
Doc Comments   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
     }
314 314
 
315 315
     /**
316
-     * @param array $step
316
+     * @param MigrationStep $step
317 317
      * @return string
318 318
      */
319 319
     protected function getReferencesType($step)
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
     }
323 323
 
324 324
     /**
325
-     * @param array $step
325
+     * @param MigrationStep $step
326 326
      * @return bool
327 327
      */
328 328
     protected function allowEmptyReferences($step)
@@ -343,6 +343,9 @@  discard block
 block discarded – undo
343 343
         return preg_replace('/(?<!^)[A-Z]/', ' $0', $className);
344 344
     }
345 345
 
346
+    /**
347
+     * @param AbstractCollection $collection
348
+     */
346 349
     protected function getCollectionName($collection)
347 350
     {
348 351
         $className = get_class($collection);
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -329,8 +329,9 @@
 block discarded – undo
329 329
     {
330 330
         if (isset($step->dsl['references_type']) && $step->dsl['references_type'] == self::REFERENCE_TYPE_ARRAY &&
331 331
             isset($step->dsl['references_allow_empty']) && $step->dsl['references_allow_empty'] == true
332
-        )
333
-            return true;
332
+        ) {
333
+                    return true;
334
+        }
334 335
         return false;
335 336
     }
336 337
 
Please login to merge, or discard this patch.
Core/ReferenceResolver/LoopResolver.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
      */
36 36
     public function getReferenceValue($identifier)
37 37
     {
38
-        switch(substr($identifier, 5)) {
38
+        switch (substr($identifier, 5)) {
39 39
             case 'iteration':
40 40
                 $current = end($this->stack);
41 41
                 return $current['step'];
Please login to merge, or discard this patch.
Core/Executor/LoopExecutor.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
                     $subStep = new MigrationStep($type, $stepDef, array_merge($step->context, array()));
81 81
                     try {
82 82
                         $result = $stepExecutors[$j]->execute($subStep);
83
-                    } catch(MigrationStepSkippedException $e) {
83
+                    } catch (MigrationStepSkippedException $e) {
84 84
                         // all ok, continue the loop
85 85
                     }
86 86
                 }
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
                     $subStep = new MigrationStep($type, $stepDef, array_merge($step->context, array()));
98 98
                     try {
99 99
                         $result = $stepExecutors[$j]->execute($subStep);
100
-                    } catch(MigrationStepSkippedException $e) {
100
+                    } catch (MigrationStepSkippedException $e) {
101 101
                         // all ok, continue the loop
102 102
                     }
103 103
                 }
Please login to merge, or discard this patch.
Core/Matcher/QueryBasedMatcher.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -308,6 +308,9 @@
 block discarded – undo
308 308
         return $out;
309 309
     }
310 310
 
311
+    /**
312
+     * @return string
313
+     */
311 314
     protected function hash2SortOrder($value)
312 315
     {
313 316
         $sortOrder = null;
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
                 return new Query\Criterion\DateMetadata(Query\Criterion\DateMetadata::CREATED, self::$operatorsMap[$operator], $match);
147 147
 
148 148
             case self::MATCH_GROUP:
149
-                foreach($values as &$value) {
149
+                foreach ($values as &$value) {
150 150
                     if (!ctype_digit($value)) {
151 151
                         $value = $this->groupMatcher->matchOneByKey($value)->id;
152 152
                     }
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
                 return new Query\Criterion\DateMetadata(Query\Criterion\DateMetadata::MODIFIED, self::$operatorsMap[$operator], $match);
166 166
 
167 167
             case self::MATCH_OBJECT_STATE:
168
-                foreach($values as &$value) {
168
+                foreach ($values as &$value) {
169 169
                     if (!ctype_digit($value)) {
170 170
                         $value = $this->stateMatcher->matchOneByKey($value)->id;
171 171
                     }
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
                 return new Query\Criterion\ObjectStateId($values);
174 174
 
175 175
             case self::MATCH_OWNER:
176
-                foreach($values as &$value) {
176
+                foreach ($values as &$value) {
177 177
                     if (!ctype_digit($value)) {
178 178
                         $value = $this->userMatcher->matchOneByKey($value)->id;
179 179
                     }
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
                 return new Query\Criterion\ParentLocationId($locationIds);
194 194
 
195 195
             case self::MATCH_SECTION:
196
-                foreach($values as &$value) {
196
+                foreach ($values as &$value) {
197 197
                     if (!ctype_digit($value)) {
198 198
                         $value = $this->sectionMatcher->matchOneByKey($value)->id;
199 199
                     }
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
 
215 215
             case self::MATCH_AND:
216 216
                 $subCriteria = array();
217
-                foreach($values as $subCriterion) {
217
+                foreach ($values as $subCriterion) {
218 218
                     $value = reset($subCriterion);
219 219
                     $subCriteria[] = $this->getQueryCriterion(key($subCriterion), $value);
220 220
                 }
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
 
223 223
             case self::MATCH_OR:
224 224
                 $subCriteria = array();
225
-                foreach($values as $subCriterion) {
225
+                foreach ($values as $subCriterion) {
226 226
                     $value = reset($subCriterion);
227 227
                     $subCriteria[] = $this->getQueryCriterion(key($subCriterion), $value);
228 228
                 }
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
 
260 260
             $direction = $this->hash2SortOrder($sortItem['sort_order']);
261 261
 
262
-            switch($sortItem['sort_field']) {
262
+            switch ($sortItem['sort_field']) {
263 263
                 case SELF::SORT_CONTENT_ID:
264 264
                     $out[] = new SortClause\ContentId($direction);
265 265
                     break;
Please login to merge, or discard this patch.
Core/Helper/SortConverter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@
 block discarded – undo
40 40
     public function sortField2Hash($value)
41 41
     {
42 42
         $ref = new \ReflectionClass('eZ\Publish\API\Repository\Values\Content\Location');
43
-        foreach($ref->getConstants() as $key => $val) {
43
+        foreach ($ref->getConstants() as $key => $val) {
44 44
             if (strpos($key, 'SORT_FIELD_') === 0 && $val == $value) {
45 45
                 $out = strtolower(substr($key, 11));
46 46
                 if ($out == 'contentobject_id') {
Please login to merge, or discard this patch.