Completed
Pull Request — master (#180)
by
unknown
08:24
created
Core/Executor/ServiceExecutor.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -74,7 +74,7 @@
 block discarded – undo
74 74
         } else {
75 75
             $args = array();
76 76
         }
77
-        foreach($args as &$val) {
77
+        foreach ($args as &$val) {
78 78
             $val = $this->resolveReferencesRecursively($val);
79 79
         }
80 80
 
Please login to merge, or discard this patch.
Core/Executor/FileExecutor.php 1 patch
Doc Comments   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
     /**
69 69
      * @param array $dsl
70 70
      * @param array $context
71
-     * @return string
71
+     * @return boolean
72 72
      * @throws \Exception
73 73
      */
74 74
     protected function exists($dsl, $context)
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
     /**
197 197
      * @param array $dsl
198 198
      * @param array $context
199
-     * @return true
199
+     * @return boolean
200 200
      * @throws \Exception
201 201
      */
202 202
     protected function copy($dsl, $context)
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
     /**
229 229
      * @param array $dsl
230 230
      * @param array $context
231
-     * @return true
231
+     * @return boolean
232 232
      * @throws \Exception
233 233
      */
234 234
     protected function move($dsl, $context)
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
     /**
261 261
      * @param array $dsl
262 262
      * @param array $context
263
-     * @return true
263
+     * @return boolean
264 264
      * @throws \Exception
265 265
      */
266 266
     protected function delete($dsl, $context)
Please login to merge, or discard this patch.
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/LanguageManager.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,6 @@
 block discarded – undo
3 3
 namespace Kaliop\eZMigrationBundle\Core\Executor;
4 4
 
5 5
 use eZ\Publish\API\Repository\Values\Content\Language;
6
-use Kaliop\eZMigrationBundle\API\Collection\LanguageCollection;
7 6
 
8 7
 /**
9 8
  * Handles language migrations.
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.