Completed
Push — 19.x ( d5ef00 )
by Tim
01:16
created
RoboFile.php 2 patches
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -60,9 +60,9 @@  discard block
 block discarded – undo
60 60
     {
61 61
         // optimize autoloader with custom path
62 62
         $this->taskComposerInstall()
63
-             ->preferDist()
64
-             ->optimizeAutoloader()
65
-             ->run();
63
+                ->preferDist()
64
+                ->optimizeAutoloader()
65
+                ->run();
66 66
     }
67 67
 
68 68
     /**
@@ -74,9 +74,9 @@  discard block
 block discarded – undo
74 74
     {
75 75
         // optimize autoloader with custom path
76 76
         $this->taskComposerUpdate()
77
-             ->preferDist()
78
-             ->optimizeAutoloader()
79
-             ->run();
77
+                ->preferDist()
78
+                ->optimizeAutoloader()
79
+                ->run();
80 80
     }
81 81
 
82 82
     /**
@@ -97,10 +97,10 @@  discard block
 block discarded – undo
97 97
     public function prepare()
98 98
     {
99 99
         $this->taskFileSystemStack()
100
-             ->mkdir($this->properties['dist.dir'])
101
-             ->mkdir($this->properties['target.dir'])
102
-             ->mkdir(sprintf('%s/reports', $this->properties['target.dir']))
103
-             ->run();
100
+                ->mkdir($this->properties['dist.dir'])
101
+                ->mkdir($this->properties['target.dir'])
102
+                ->mkdir(sprintf('%s/reports', $this->properties['target.dir']))
103
+                ->run();
104 104
     }
105 105
 
106 106
     /**
@@ -170,8 +170,8 @@  discard block
 block discarded – undo
170 170
 
171 171
         // run PHPUnit
172 172
         $this->taskPHPUnit(sprintf('%s/bin/phpunit', $this->properties['vendor.dir']))
173
-             ->configFile('phpunit.xml')
174
-             ->run();
173
+                ->configFile('phpunit.xml')
174
+                ->run();
175 175
     }
176 176
 
177 177
     /**
Please login to merge, or discard this patch.
Unused Use Statements   -4 removed lines patch added patch discarded remove patch
@@ -18,10 +18,6 @@
 block discarded – undo
18 18
  * @link      http://www.techdivision.com
19 19
  */
20 20
 
21
-use Lurker\Event\FilesystemEvent;
22
-
23
-use Symfony\Component\Finder\Finder;
24
-
25 21
 /**
26 22
  * Defines the available build tasks.
27 23
  *
Please login to merge, or discard this patch.
src/Services/ProductUrlRewriteProcessor.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -151,7 +151,7 @@
 block discarded – undo
151 151
      * Commits a transaction, returning the database connection to autocommit mode until the next call to
152 152
      * ProductProcessor::beginTransaction() starts a new transaction.
153 153
      *
154
-     * @return boolean Returns TRUE on success or FALSE on failure
154
+     * @return boolean|null Returns TRUE on success or FALSE on failure
155 155
      * @link http://php.net/manual/en/pdo.commit.php
156 156
      */
157 157
     public function commit()
Please login to merge, or discard this patch.
src/Observers/UrlRewriteObserver.php 2 patches
Indentation   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -197,14 +197,14 @@  discard block
 block discarded – undo
197 197
         if ($storeViewCode === StoreViewCodes::ADMIN) {
198 198
             // log a message and return
199 199
             $this->getSubject()
200
-                 ->getSystemLogger()
201
-                 ->debug(
202
-                     sprintf(
203
-                         'Store with code "%s" is not active, no URL rewrites will be created for product with SKU "%s"',
204
-                         $storeViewCode,
205
-                         $sku
206
-                     )
207
-                 );
200
+                    ->getSystemLogger()
201
+                    ->debug(
202
+                        sprintf(
203
+                            'Store with code "%s" is not active, no URL rewrites will be created for product with SKU "%s"',
204
+                            $storeViewCode,
205
+                            $sku
206
+                        )
207
+                    );
208 208
 
209 209
             // return without creating any rewrites
210 210
             return $this->getRow();
@@ -214,14 +214,14 @@  discard block
 block discarded – undo
214 214
         if (!$this->getSubject()->storeIsActive($storeViewCode)) {
215 215
             // log a message and return
216 216
             $this->getSubject()
217
-                 ->getSystemLogger()
218
-                 ->debug(
219
-                     sprintf(
220
-                         'Store with code "%s" is not active, no URL rewrites will be created for product with SKU "%s"',
221
-                         $storeViewCode,
222
-                         $sku
223
-                     )
224
-                 );
217
+                    ->getSystemLogger()
218
+                    ->debug(
219
+                        sprintf(
220
+                            'Store with code "%s" is not active, no URL rewrites will be created for product with SKU "%s"',
221
+                            $storeViewCode,
222
+                            $sku
223
+                        )
224
+                    );
225 225
 
226 226
             // return without creating any rewrites
227 227
             return $this->getRow();
@@ -237,13 +237,13 @@  discard block
 block discarded – undo
237 237
         if (!$this->isVisible()) {
238 238
             // log a message
239 239
             $this->getSubject()
240
-                 ->getSystemLogger()
241
-                 ->debug(
242
-                     sprintf(
243
-                         'Product with SKU "%s" is not visible, so no URL rewrites will be created',
244
-                         $sku
245
-                     )
246
-                 );
240
+                    ->getSystemLogger()
241
+                    ->debug(
242
+                        sprintf(
243
+                            'Product with SKU "%s" is not visible, so no URL rewrites will be created',
244
+                            $sku
245
+                        )
246
+                    );
247 247
 
248 248
             // return without creating any rewrites
249 249
             return $this->getRow();
@@ -298,8 +298,8 @@  discard block
 block discarded – undo
298 298
                     // query whether or not debug mode has been enabled
299 299
                     if ($this->getSubject()->isDebugMode()) {
300 300
                         $this->getSubject()
301
-                             ->getSystemLogger()
302
-                             ->warning($this->getSubject()->appendExceptionSuffix($e->getMessage()));
301
+                                ->getSystemLogger()
302
+                                ->warning($this->getSubject()->appendExceptionSuffix($e->getMessage()));
303 303
                     } else {
304 304
                         throw $e;
305 305
                     }
@@ -363,8 +363,8 @@  discard block
 block discarded – undo
363 363
                 // query whether or not debug mode has been enabled
364 364
                 if ($this->getSubject()->isDebugMode()) {
365 365
                     $this->getSubject()
366
-                         ->getSystemLogger()
367
-                         ->warning($this->getSubject()->appendExceptionSuffix($e->getMessage()));
366
+                            ->getSystemLogger()
367
+                            ->warning($this->getSubject()->appendExceptionSuffix($e->getMessage()));
368 368
                 } else {
369 369
                     throw $e;
370 370
                 }
@@ -412,8 +412,8 @@  discard block
 block discarded – undo
412 412
                 $this->productCategoryIds[] = $categoryId;
413 413
             } else {
414 414
                 $this->getSubject()
415
-                     ->getSystemLogger()
416
-                     ->debug(sprintf('Don\'t create URL rewrite for category "%s" because of missing anchor flag', $category[MemberNames::PATH]));
415
+                        ->getSystemLogger()
416
+                        ->debug(sprintf('Don\'t create URL rewrite for category "%s" because of missing anchor flag', $category[MemberNames::PATH]));
417 417
             }
418 418
         }
419 419
 
Please login to merge, or discard this patch.
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
     /**
118 118
      * Return's the product bunch processor instance.
119 119
      *
120
-     * @return \TechDivision\Import\Product\Services\ProductBunchProcessorInterface The product bunch processor instance
120
+     * @return ProductUrlRewriteProcessorInterface The product bunch processor instance
121 121
      */
122 122
     protected function getProductUrlRewriteProcessor()
123 123
     {
@@ -622,7 +622,7 @@  discard block
 block discarded – undo
622 622
      * @param string $path          The path of the category to return
623 623
      * @param string $storeViewCode The store view code of the category to return
624 624
      *
625
-     * @return array The category
625
+     * @return string The category
626 626
      */
627 627
     protected function getCategoryByPath($path, $storeViewCode = StoreViewCodes::ADMIN)
628 628
     {
Please login to merge, or discard this patch.
src/Observers/UrlRewriteUpdateObserver.php 1 patch
Indentation   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -98,14 +98,14 @@  discard block
 block discarded – undo
98 98
 
99 99
                             // finally log a warning that the old category is not available ony more
100 100
                             $this->getSubject()
101
-                                 ->getSystemLogger()
102
-                                 ->warning(
103
-                                     sprintf(
104
-                                         'Category with ID "%d" is not longer available for URL rewrite with ID "%d"',
105
-                                         $metadata[UrlRewriteObserver::CATEGORY_ID],
106
-                                         $existingUrlRewrite[MemberNames::URL_REWRITE_ID]
107
-                                     )
108
-                                 );
101
+                                    ->getSystemLogger()
102
+                                    ->warning(
103
+                                        sprintf(
104
+                                            'Category with ID "%d" is not longer available for URL rewrite with ID "%d"',
105
+                                            $metadata[UrlRewriteObserver::CATEGORY_ID],
106
+                                            $existingUrlRewrite[MemberNames::URL_REWRITE_ID]
107
+                                        )
108
+                                    );
109 109
                         }
110 110
                     }
111 111
                 }
@@ -117,14 +117,14 @@  discard block
 block discarded – undo
117 117
                 if ($targetPath === $existingUrlRewrite[MemberNames::REQUEST_PATH]) {
118 118
                     // finally log a warning that the old category is not available ony more
119 119
                     $this->getSubject()
120
-                         ->getSystemLogger()
121
-                         ->warning(
122
-                             sprintf(
123
-                                 'New target path "%s" eqals request path for URL rewrite with ID "%d"',
124
-                                 $existingUrlRewrite[MemberNames::REQUEST_PATH],
125
-                                 $existingUrlRewrite[MemberNames::URL_REWRITE_ID]
126
-                             )
127
-                         );
120
+                            ->getSystemLogger()
121
+                            ->warning(
122
+                                sprintf(
123
+                                    'New target path "%s" eqals request path for URL rewrite with ID "%d"',
124
+                                    $existingUrlRewrite[MemberNames::REQUEST_PATH],
125
+                                    $existingUrlRewrite[MemberNames::URL_REWRITE_ID]
126
+                                )
127
+                            );
128 128
 
129 129
                     // stop processing the URL rewrite
130 130
                     continue;
@@ -149,14 +149,14 @@  discard block
 block discarded – undo
149 149
 
150 150
                     // log a message, that old URL rewrites have been cleaned-up
151 151
                     $this->getSubject()
152
-                         ->getSystemLogger()
153
-                         ->warning(
154
-                             sprintf(
155
-                                 'Cleaned-up %d URL rewrite "%s" for product with SKU "%s"',
156
-                                 $existingUrlRewrite[MemberNames::REQUEST_PATH],
157
-                                 $this->getValue(ColumnKeys::SKU)
158
-                             )
159
-                         );
152
+                            ->getSystemLogger()
153
+                            ->warning(
154
+                                sprintf(
155
+                                    'Cleaned-up %d URL rewrite "%s" for product with SKU "%s"',
156
+                                    $existingUrlRewrite[MemberNames::REQUEST_PATH],
157
+                                    $this->getValue(ColumnKeys::SKU)
158
+                                )
159
+                            );
160 160
                 }
161 161
             }
162 162
         }
Please login to merge, or discard this patch.
tests/unit/Observers/UrlRewriteObserverTest.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -66,8 +66,8 @@  discard block
 block discarded – undo
66 66
 
67 67
         // initialize a mock processor instance
68 68
         $this->mockProductUrlRewriteProcessor = $this->getMockBuilder('TechDivision\Import\Product\UrlRewrite\Services\ProductUrlRewriteProcessorInterface')
69
-                                                     ->setMethods(get_class_methods('TechDivision\Import\Product\UrlRewrite\Services\ProductUrlRewriteProcessorInterface'))
70
-                                                     ->getMock();
69
+                                                        ->setMethods(get_class_methods('TechDivision\Import\Product\UrlRewrite\Services\ProductUrlRewriteProcessorInterface'))
70
+                                                        ->getMock();
71 71
 
72 72
         // initialize the observer
73 73
         $this->observer = new UrlRewriteObserver($this->mockProductUrlRewriteProcessor);
@@ -239,12 +239,12 @@  discard block
 block discarded – undo
239 239
 
240 240
         // initialize the categories
241 241
         $categories = array(
242
-             $path1 = 'Default Category'                                => array(MemberNames::ENTITY_ID => 2, MemberNames::PARENT_ID => 1, MemberNames::IS_ANCHOR => null, MemberNames::URL_PATH => null, MemberNames::PATH => $path1),
243
-             $path2 = 'Default Category/Men'                            => array(MemberNames::ENTITY_ID => 3, MemberNames::PARENT_ID => 2, MemberNames::IS_ANCHOR => null, MemberNames::URL_PATH => 'men', MemberNames::PATH => $path2),
244
-             $path3 = 'Default Category/Men/Tops'                       => array(MemberNames::ENTITY_ID => 4, MemberNames::PARENT_ID => 3, MemberNames::IS_ANCHOR => null, MemberNames::URL_PATH => 'men/tops-men', MemberNames::PATH => $path3),
245
-             $path4 = 'Default Category/Men/Tops/Hoodies & Sweatshirts' => array(MemberNames::ENTITY_ID => 5, MemberNames::PARENT_ID => 4, MemberNames::IS_ANCHOR => null, MemberNames::URL_PATH => 'men/tops-men/hoodies-and-sweatshirts-men', MemberNames::PATH => $path4),
246
-             $path5 = 'Default Category/Collections'                    => array(MemberNames::ENTITY_ID => 6, MemberNames::PARENT_ID => 3, MemberNames::IS_ANCHOR => null, MemberNames::URL_PATH => 'collections', MemberNames::PATH => $path5),
247
-             $path6 = 'Default Category/Collections/Eco Friendly'       => array(MemberNames::ENTITY_ID => 7, MemberNames::PARENT_ID => 6, MemberNames::IS_ANCHOR => null, MemberNames::URL_PATH => 'collections/eco-friendly', MemberNames::PATH => $path6),
242
+                $path1 = 'Default Category'                                => array(MemberNames::ENTITY_ID => 2, MemberNames::PARENT_ID => 1, MemberNames::IS_ANCHOR => null, MemberNames::URL_PATH => null, MemberNames::PATH => $path1),
243
+                $path2 = 'Default Category/Men'                            => array(MemberNames::ENTITY_ID => 3, MemberNames::PARENT_ID => 2, MemberNames::IS_ANCHOR => null, MemberNames::URL_PATH => 'men', MemberNames::PATH => $path2),
244
+                $path3 = 'Default Category/Men/Tops'                       => array(MemberNames::ENTITY_ID => 4, MemberNames::PARENT_ID => 3, MemberNames::IS_ANCHOR => null, MemberNames::URL_PATH => 'men/tops-men', MemberNames::PATH => $path3),
245
+                $path4 = 'Default Category/Men/Tops/Hoodies & Sweatshirts' => array(MemberNames::ENTITY_ID => 5, MemberNames::PARENT_ID => 4, MemberNames::IS_ANCHOR => null, MemberNames::URL_PATH => 'men/tops-men/hoodies-and-sweatshirts-men', MemberNames::PATH => $path4),
246
+                $path5 = 'Default Category/Collections'                    => array(MemberNames::ENTITY_ID => 6, MemberNames::PARENT_ID => 3, MemberNames::IS_ANCHOR => null, MemberNames::URL_PATH => 'collections', MemberNames::PATH => $path5),
247
+                $path6 = 'Default Category/Collections/Eco Friendly'       => array(MemberNames::ENTITY_ID => 7, MemberNames::PARENT_ID => 6, MemberNames::IS_ANCHOR => null, MemberNames::URL_PATH => 'collections/eco-friendly', MemberNames::PATH => $path6),
248 248
         );
249 249
 
250 250
         // initialize a mock import adapter instance
@@ -256,8 +256,8 @@  discard block
 block discarded – undo
256 256
 
257 257
         // mock the system logger
258 258
         $mockSystemLogger = $this->getMockBuilder('Psr\Log\LoggerInterface')
259
-                                 ->setMethods(get_class_methods('Psr\Log\LoggerInterface'))
260
-                                 ->getMock();
259
+                                    ->setMethods(get_class_methods('Psr\Log\LoggerInterface'))
260
+                                    ->getMock();
261 261
 
262 262
         // create a mock subject
263 263
         $mockSubject = $this->getMockBuilder('TechDivision\Import\Product\UrlRewrite\Subjects\UrlRewriteSubject')
@@ -389,7 +389,7 @@  discard block
 block discarded – undo
389 389
                         array(CoreConfigDataKeys::CATALOG_SEO_PRODUCT_URL_SUFFIX, '.html')
390 390
                     )
391 391
                     ->willReturnOnConsecutiveCalls('.html', '.html', '.html');
392
-       $mockSubject->expects(($this->once()))
392
+        $mockSubject->expects(($this->once()))
393 393
                     ->method('getImportAdapter')
394 394
                     ->willReturn($mockImportAdapter);
395 395
 
Please login to merge, or discard this patch.
tests/unit/Observers/UrlRewriteUpdateObserverTest.php 1 patch
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -66,8 +66,8 @@  discard block
 block discarded – undo
66 66
 
67 67
         // initialize a mock processor instance
68 68
         $this->mockProductUrlRewriteProcessor = $this->getMockBuilder('TechDivision\Import\Product\UrlRewrite\Services\ProductUrlRewriteProcessorInterface')
69
-                                                     ->setMethods(get_class_methods('TechDivision\Import\Product\UrlRewrite\Services\ProductUrlRewriteProcessorInterface'))
70
-                                                     ->getMock();
69
+                                                        ->setMethods(get_class_methods('TechDivision\Import\Product\UrlRewrite\Services\ProductUrlRewriteProcessorInterface'))
70
+                                                        ->getMock();
71 71
 
72 72
         // initialize the observer
73 73
         $this->observer = new UrlRewriteUpdateObserver($this->mockProductUrlRewriteProcessor);
@@ -104,14 +104,14 @@  discard block
 block discarded – undo
104 104
 
105 105
         // initialize the categories
106 106
         $categories = array(
107
-             $path1 = 'Default Category'                                => array(MemberNames::ENTITY_ID => 2, MemberNames::PARENT_ID => 1, MemberNames::IS_ANCHOR => null, MemberNames::URL_PATH => null, MemberNames::PATH => $path1),
108
-             $path2 = 'Default Category/Men'                            => array(MemberNames::ENTITY_ID => 3, MemberNames::PARENT_ID => 2, MemberNames::IS_ANCHOR => null, MemberNames::URL_PATH => 'men', MemberNames::PATH => $path2),
109
-             $path3 = 'Default Category/Men/Tops'                       => array(MemberNames::ENTITY_ID => 4, MemberNames::PARENT_ID => 3, MemberNames::IS_ANCHOR => null, MemberNames::URL_PATH => 'men/tops-men', MemberNames::PATH => $path3),
110
-             $path4 = 'Default Category/Men/Tops/Hoodies & Sweatshirts' => array(MemberNames::ENTITY_ID => 5, MemberNames::PARENT_ID => 4, MemberNames::IS_ANCHOR => null, MemberNames::URL_PATH => 'men/tops-men/hoodies-and-sweatshirts-men', MemberNames::PATH => $path4),
111
-             $path5 = 'Default Category/Collections'                    => array(MemberNames::ENTITY_ID => 6, MemberNames::PARENT_ID => 3, MemberNames::IS_ANCHOR => null, MemberNames::URL_PATH => 'collections', MemberNames::PATH => $path5),
112
-             $path6 = 'Default Category/Collections/Eco Friendly'       => array(MemberNames::ENTITY_ID => 7, MemberNames::PARENT_ID => 6, MemberNames::IS_ANCHOR => null, MemberNames::URL_PATH => 'collections/eco-friendly', MemberNames::PATH => $path6),
113
-             $path7 = 'Default Category/Collections/Old'                => array(MemberNames::ENTITY_ID => 8, MemberNames::PARENT_ID => 6, MemberNames::IS_ANCHOR => null, MemberNames::URL_PATH => 'collections/old', MemberNames::PATH => $path7),
114
-             $path8 = 'Default Category/Men/Old'                        => array(MemberNames::ENTITY_ID => 9, MemberNames::PARENT_ID => 3, MemberNames::IS_ANCHOR => null, MemberNames::URL_PATH => 'men/old', MemberNames::PATH => $path8),
107
+                $path1 = 'Default Category'                                => array(MemberNames::ENTITY_ID => 2, MemberNames::PARENT_ID => 1, MemberNames::IS_ANCHOR => null, MemberNames::URL_PATH => null, MemberNames::PATH => $path1),
108
+                $path2 = 'Default Category/Men'                            => array(MemberNames::ENTITY_ID => 3, MemberNames::PARENT_ID => 2, MemberNames::IS_ANCHOR => null, MemberNames::URL_PATH => 'men', MemberNames::PATH => $path2),
109
+                $path3 = 'Default Category/Men/Tops'                       => array(MemberNames::ENTITY_ID => 4, MemberNames::PARENT_ID => 3, MemberNames::IS_ANCHOR => null, MemberNames::URL_PATH => 'men/tops-men', MemberNames::PATH => $path3),
110
+                $path4 = 'Default Category/Men/Tops/Hoodies & Sweatshirts' => array(MemberNames::ENTITY_ID => 5, MemberNames::PARENT_ID => 4, MemberNames::IS_ANCHOR => null, MemberNames::URL_PATH => 'men/tops-men/hoodies-and-sweatshirts-men', MemberNames::PATH => $path4),
111
+                $path5 = 'Default Category/Collections'                    => array(MemberNames::ENTITY_ID => 6, MemberNames::PARENT_ID => 3, MemberNames::IS_ANCHOR => null, MemberNames::URL_PATH => 'collections', MemberNames::PATH => $path5),
112
+                $path6 = 'Default Category/Collections/Eco Friendly'       => array(MemberNames::ENTITY_ID => 7, MemberNames::PARENT_ID => 6, MemberNames::IS_ANCHOR => null, MemberNames::URL_PATH => 'collections/eco-friendly', MemberNames::PATH => $path6),
113
+                $path7 = 'Default Category/Collections/Old'                => array(MemberNames::ENTITY_ID => 8, MemberNames::PARENT_ID => 6, MemberNames::IS_ANCHOR => null, MemberNames::URL_PATH => 'collections/old', MemberNames::PATH => $path7),
114
+                $path8 = 'Default Category/Men/Old'                        => array(MemberNames::ENTITY_ID => 9, MemberNames::PARENT_ID => 3, MemberNames::IS_ANCHOR => null, MemberNames::URL_PATH => 'men/old', MemberNames::PATH => $path8),
115 115
         );
116 116
 
117 117
         // initialize a mock import adapter instance
@@ -123,8 +123,8 @@  discard block
 block discarded – undo
123 123
 
124 124
         // mock the system logger
125 125
         $mockSystemLogger = $this->getMockBuilder('Psr\Log\LoggerInterface')
126
-                                 ->setMethods(get_class_methods('Psr\Log\LoggerInterface'))
127
-                                 ->getMock();
126
+                                    ->setMethods(get_class_methods('Psr\Log\LoggerInterface'))
127
+                                    ->getMock();
128 128
 
129 129
         // the found URL rewrites
130 130
         $urlRewrites = array(
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
                     ->method('getUrlRewritesByEntityTypeAndEntityIdAndStoreId')
318 318
                     ->with(UrlRewriteObserver::ENTITY_TYPE, $entityId, $storeId)
319 319
                     ->willReturn($urlRewrites);
320
-       $this->mockProductUrlRewriteProcessor->expects($this->exactly(6))
320
+        $this->mockProductUrlRewriteProcessor->expects($this->exactly(6))
321 321
                     ->method('persistUrlRewrite')
322 322
                     ->withConsecutive(
323 323
                         array(
Please login to merge, or discard this patch.