Completed
Push — master ( c10821...87327d )
by Tim
16s queued 11s
created
src/Observers/UrlRewriteObserver.php 1 patch
Indentation   +27 added lines, -27 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();
@@ -297,8 +297,8 @@  discard block
 block discarded – undo
297 297
                     // query whether or not debug mode has been enabled
298 298
                     if ($this->getSubject()->isDebugMode()) {
299 299
                         $this->getSubject()
300
-                             ->getSystemLogger()
301
-                             ->warning($this->getSubject()->appendExceptionSuffix($e->getMessage()));
300
+                                ->getSystemLogger()
301
+                                ->warning($this->getSubject()->appendExceptionSuffix($e->getMessage()));
302 302
                     } else {
303 303
                         throw $e;
304 304
                     }
@@ -365,8 +365,8 @@  discard block
 block discarded – undo
365 365
                 // query whether or not debug mode has been enabled
366 366
                 if ($this->getSubject()->isDebugMode()) {
367 367
                     $this->getSubject()
368
-                         ->getSystemLogger()
369
-                         ->warning($this->getSubject()->appendExceptionSuffix($e->getMessage()));
368
+                            ->getSystemLogger()
369
+                            ->warning($this->getSubject()->appendExceptionSuffix($e->getMessage()));
370 370
                 } else {
371 371
                     throw $e;
372 372
                 }
Please login to merge, or discard this patch.
tests/unit/Observers/UrlRewriteUpdateObserverTest.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,6 @@
 block discarded – undo
24 24
 use TechDivision\Import\Utils\EntityStatus;
25 25
 use TechDivision\Import\Utils\StoreViewCodes;
26 26
 use TechDivision\Import\Product\Utils\VisibilityKeys;
27
-use TechDivision\Import\Product\Utils\CoreConfigDataKeys;
28 27
 use TechDivision\Import\Product\UrlRewrite\Utils\ColumnKeys;
29 28
 use TechDivision\Import\Product\UrlRewrite\Utils\MemberNames;
30 29
 use TechDivision\Import\Adapter\SerializerAwareAdapterInterface;
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -301,7 +301,7 @@
 block discarded – undo
301 301
         $mockSubject->expects($this->any())
302 302
                     ->method('getCoreConfigData')
303 303
                     ->will(
304
-                        $this->returnCallback(function ($arg1, $arg2) {
304
+                        $this->returnCallback(function($arg1, $arg2) {
305 305
                             return $arg2;
306 306
                         })
307 307
                     );
Please login to merge, or discard this patch.
tests/unit/Observers/UrlRewriteObserverTest.php 2 patches
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -68,8 +68,8 @@  discard block
 block discarded – undo
68 68
 
69 69
         // initialize a mock processor instance
70 70
         $this->mockProductUrlRewriteProcessor = $this->getMockBuilder('TechDivision\Import\Product\UrlRewrite\Services\ProductUrlRewriteProcessorInterface')
71
-                                                     ->setMethods(get_class_methods('TechDivision\Import\Product\UrlRewrite\Services\ProductUrlRewriteProcessorInterface'))
72
-                                                     ->getMock();
71
+                                                        ->setMethods(get_class_methods('TechDivision\Import\Product\UrlRewrite\Services\ProductUrlRewriteProcessorInterface'))
72
+                                                        ->getMock();
73 73
 
74 74
         // initialize the observer
75 75
         $this->observer = new UrlRewriteObserver($this->mockProductUrlRewriteProcessor);
@@ -304,12 +304,12 @@  discard block
 block discarded – undo
304 304
 
305 305
         // initialize the categories
306 306
         $categories = array(
307
-             $path1 = 'Default Category'                                => array(MemberNames::ENTITY_ID => 2, MemberNames::PARENT_ID => 1, MemberNames::IS_ANCHOR => null, MemberNames::URL_PATH => null, MemberNames::PATH => $path1),
308
-             $path2 = 'Default Category/Men'                            => array(MemberNames::ENTITY_ID => 3, MemberNames::PARENT_ID => 2, MemberNames::IS_ANCHOR => null, MemberNames::URL_PATH => 'men', MemberNames::PATH => $path2),
309
-             $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),
310
-             $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),
311
-             $path5 = 'Default Category/Collections'                    => array(MemberNames::ENTITY_ID => 6, MemberNames::PARENT_ID => 3, MemberNames::IS_ANCHOR => null, MemberNames::URL_PATH => 'collections', MemberNames::PATH => $path5),
312
-             $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),
307
+                $path1 = 'Default Category'                                => array(MemberNames::ENTITY_ID => 2, MemberNames::PARENT_ID => 1, MemberNames::IS_ANCHOR => null, MemberNames::URL_PATH => null, MemberNames::PATH => $path1),
308
+                $path2 = 'Default Category/Men'                            => array(MemberNames::ENTITY_ID => 3, MemberNames::PARENT_ID => 2, MemberNames::IS_ANCHOR => null, MemberNames::URL_PATH => 'men', MemberNames::PATH => $path2),
309
+                $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),
310
+                $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),
311
+                $path5 = 'Default Category/Collections'                    => array(MemberNames::ENTITY_ID => 6, MemberNames::PARENT_ID => 3, MemberNames::IS_ANCHOR => null, MemberNames::URL_PATH => 'collections', MemberNames::PATH => $path5),
312
+                $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),
313 313
         );
314 314
 
315 315
         // initialize a mock import adapter instance
@@ -331,8 +331,8 @@  discard block
 block discarded – undo
331 331
 
332 332
         // mock the system logger
333 333
         $mockSystemLogger = $this->getMockBuilder('Psr\Log\LoggerInterface')
334
-                                 ->setMethods(get_class_methods('Psr\Log\LoggerInterface'))
335
-                                 ->getMock();
334
+                                    ->setMethods(get_class_methods('Psr\Log\LoggerInterface'))
335
+                                    ->getMock();
336 336
 
337 337
         // create a mock subject
338 338
         $mockSubject = $this->getMockBuilder('TechDivision\Import\Product\UrlRewrite\Subjects\UrlRewriteSubject')
@@ -463,7 +463,7 @@  discard block
 block discarded – undo
463 463
                             return $arg2;
464 464
                         })
465 465
                     );
466
-       $mockSubject->expects(($this->exactly(4)))
466
+        $mockSubject->expects(($this->exactly(4)))
467 467
                     ->method('getImportAdapter')
468 468
                     ->willReturn($mockImportAdapter);
469 469
 
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -301,7 +301,7 @@
 block discarded – undo
301 301
         $mockSubject->expects($this->any())
302 302
                     ->method('getCoreConfigData')
303 303
                     ->will(
304
-                        $this->returnCallback(function ($arg1, $arg2) {
304
+                        $this->returnCallback(function($arg1, $arg2) {
305 305
                             return $arg2;
306 306
                         })
307 307
                     );
Please login to merge, or discard this patch.