@@ -74,7 +74,7 @@ |
||
74 | 74 | } |
75 | 75 | |
76 | 76 | $subCommand = new $className(); |
77 | - if (! $subCommand instanceof SubCommandInterface) { |
|
77 | + if (!$subCommand instanceof SubCommandInterface) { |
|
78 | 78 | throw new \InvalidArgumentException('Subcommand must implement SubCommandInterface.'); |
79 | 79 | } |
80 | 80 |
@@ -47,8 +47,7 @@ |
||
47 | 47 | } |
48 | 48 | |
49 | 49 | $timezone = $input->getOption('timezone') |
50 | - ? $input->getOption('timezone') : |
|
51 | - $this->_scopeConfig->getValue('general/locale/timezone'); |
|
50 | + ? $input->getOption('timezone') : $this->_scopeConfig->getValue('general/locale/timezone'); |
|
52 | 51 | |
53 | 52 | if (!$input->getOption('format')) { |
54 | 53 | $output->writeln('<info>Times shown in <comment>' . $timezone . '</comment></info>'); |
@@ -43,15 +43,15 @@ discard block |
||
43 | 43 | ->get('\Magento\Framework\Filesystem') |
44 | 44 | ->getDirectoryWrite(MaintenanceMode::FLAG_DIR); |
45 | 45 | |
46 | - if (! is_null($input->getOption('off'))) { |
|
47 | - if (! $flagDir->isExist(MaintenanceMode::FLAG_FILENAME)) { |
|
46 | + if (!is_null($input->getOption('off'))) { |
|
47 | + if (!$flagDir->isExist(MaintenanceMode::FLAG_FILENAME)) { |
|
48 | 48 | return $output->writeln(self::ALREADY_DISABLED_MESSAGE); |
49 | 49 | } |
50 | 50 | |
51 | 51 | return $this->handleDisable($flagDir, $output, $input->getOption('off')); |
52 | 52 | } |
53 | 53 | |
54 | - if (! is_null($input->getOption('on'))) { |
|
54 | + if (!is_null($input->getOption('on'))) { |
|
55 | 55 | if ($flagDir->isExist(MaintenanceMode::FLAG_FILENAME)) { |
56 | 56 | return $output->writeln(self::ALREADY_ENABLED_MESSAGE); |
57 | 57 | } |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | protected function handleDisable( |
76 | 76 | \Magento\Framework\Filesystem\Directory\Write $flagDir, |
77 | 77 | OutputInterface $output, |
78 | - $offOption= null |
|
78 | + $offOption = null |
|
79 | 79 | ) { |
80 | 80 | $flagDir->delete(MaintenanceMode::FLAG_FILENAME); |
81 | 81 | $output->writeln(self::DISABLED_MESSAGE); |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | $flagDir->touch(MaintenanceMode::FLAG_FILENAME); |
101 | 101 | $output->writeln(self::ENABLED_MESSAGE); |
102 | 102 | |
103 | - if (! is_null($onOption)) { |
|
103 | + if (!is_null($onOption)) { |
|
104 | 104 | // Write IPs to exclusion file |
105 | 105 | $flagDir->writeFile(MaintenanceMode::IP_FILENAME, $onOption); |
106 | 106 | $output->writeln(self::WROTE_IP_MESSAGE); |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | protected function execute(InputInterface $input, OutputInterface $output) |
60 | 60 | { |
61 | 61 | $time = microtime(true); |
62 | - $ignoreDataUpdate = $input->getOption('ignore-data'); |
|
62 | + $ignoreDataUpdate = $input->getOption('ignore-data'); |
|
63 | 63 | |
64 | 64 | $headers = array('Setup', 'Module', 'DB', 'Data', 'Status'); |
65 | 65 | if ($ignoreDataUpdate) { |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | return $a['Status'] !== 'OK'; |
107 | 107 | }); |
108 | 108 | |
109 | - array_walk($table, function (&$row) { |
|
109 | + array_walk($table, function(&$row) { |
|
110 | 110 | $status = $row['Status']; |
111 | 111 | $availableStatus = array('OK' => 'info', 'Error' => 'error'); |
112 | 112 | $statusString = sprintf( |
@@ -32,7 +32,7 @@ |
||
32 | 32 | $argumentsToInject[] = $objectManager->get($parameter[1]); |
33 | 33 | } |
34 | 34 | |
35 | - call_user_func_array([ $object, $methodName ], $argumentsToInject); |
|
35 | + call_user_func_array([$object, $methodName], $argumentsToInject); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | /** |
@@ -1,9 +1,9 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * @todo writing unit tests for toggling caches is complicated because environments differ |
|
4 | - * touching caches changes state and will result in different test result second time |
|
5 | - * solutions: disabling/enabling, faking&mocking or having one defined test environment |
|
6 | - */ |
|
3 | + * @todo writing unit tests for toggling caches is complicated because environments differ |
|
4 | + * touching caches changes state and will result in different test result second time |
|
5 | + * solutions: disabling/enabling, faking&mocking or having one defined test environment |
|
6 | + */ |
|
7 | 7 | namespace N98\Magento\Command\Cache; |
8 | 8 | |
9 | 9 | use Symfony\Component\Console\Tester\CommandTester; |
@@ -42,7 +42,7 @@ |
||
42 | 42 | $disabledCacheTypes = 0; |
43 | 43 | |
44 | 44 | foreach ($cacheTypes as $cacheType) { |
45 | - if (! $cacheType->getStatus()) { |
|
45 | + if (!$cacheType->getStatus()) { |
|
46 | 46 | $disabledCacheTypes++; |
47 | 47 | } |
48 | 48 | } |
@@ -47,11 +47,11 @@ discard block |
||
47 | 47 | $commandTester = new CommandTester($setCommand); |
48 | 48 | $commandTester->execute( |
49 | 49 | array( |
50 | - 'command' => $setCommand->getName(), |
|
51 | - 'path' => 'n98_magerun/foo/bar', |
|
52 | - '--scope' => 'stores', |
|
53 | - '--scope-id' => $store->getId(), |
|
54 | - 'value' => 'store-' . $store->getId(), |
|
50 | + 'command' => $setCommand->getName(), |
|
51 | + 'path' => 'n98_magerun/foo/bar', |
|
52 | + '--scope' => 'stores', |
|
53 | + '--scope-id' => $store->getId(), |
|
54 | + 'value' => 'store-' . $store->getId(), |
|
55 | 55 | ) |
56 | 56 | ); |
57 | 57 | } |
@@ -59,9 +59,9 @@ discard block |
||
59 | 59 | $commandTester = new CommandTester($deleteCommand); |
60 | 60 | $commandTester->execute( |
61 | 61 | array( |
62 | - 'command' => $deleteCommand->getName(), |
|
63 | - 'path' => 'n98_magerun/foo/bar', |
|
64 | - '--all' => true, |
|
62 | + 'command' => $deleteCommand->getName(), |
|
63 | + 'path' => 'n98_magerun/foo/bar', |
|
64 | + '--all' => true, |
|
65 | 65 | ) |
66 | 66 | ); |
67 | 67 |
@@ -20,26 +20,26 @@ discard block |
||
20 | 20 | $commandTester = new CommandTester($setCommand); |
21 | 21 | $commandTester->execute( |
22 | 22 | array( |
23 | - 'command' => $setCommand->getName(), |
|
24 | - 'path' => 'n98_magerun/foo/bar', |
|
25 | - 'value' => '1234', |
|
23 | + 'command' => $setCommand->getName(), |
|
24 | + 'path' => 'n98_magerun/foo/bar', |
|
25 | + 'value' => '1234', |
|
26 | 26 | ) |
27 | 27 | ); |
28 | 28 | |
29 | 29 | $commandTester = new CommandTester($getCommand); |
30 | 30 | $commandTester->execute( |
31 | 31 | array( |
32 | - 'command' => $getCommand->getName(), |
|
33 | - 'path' => 'n98_magerun/foo/bar', |
|
32 | + 'command' => $getCommand->getName(), |
|
33 | + 'path' => 'n98_magerun/foo/bar', |
|
34 | 34 | ) |
35 | 35 | ); |
36 | 36 | $this->assertContains('| n98_magerun/foo/bar | default | 0 | 1234 |', $commandTester->getDisplay()); |
37 | 37 | |
38 | 38 | $commandTester->execute( |
39 | 39 | array( |
40 | - 'command' => $getCommand->getName(), |
|
41 | - 'path' => 'n98_magerun/foo/bar', |
|
42 | - '--update-script' => true |
|
40 | + 'command' => $getCommand->getName(), |
|
41 | + 'path' => 'n98_magerun/foo/bar', |
|
42 | + '--update-script' => true |
|
43 | 43 | ) |
44 | 44 | ); |
45 | 45 | $this->assertContains( |
@@ -49,9 +49,9 @@ discard block |
||
49 | 49 | |
50 | 50 | $commandTester->execute( |
51 | 51 | array( |
52 | - 'command' => $getCommand->getName(), |
|
53 | - 'path' => 'n98_magerun/foo/bar', |
|
54 | - '--magerun-script' => true |
|
52 | + 'command' => $getCommand->getName(), |
|
53 | + 'path' => 'n98_magerun/foo/bar', |
|
54 | + '--magerun-script' => true |
|
55 | 55 | ) |
56 | 56 | ); |
57 | 57 | $this->assertContains( |