aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Command/InstallCommand.php
diff options
context:
space:
mode:
authorJeremy Benoist <jeremy.benoist@gmail.com>2016-03-27 20:35:56 +0200
committerJeremy Benoist <jeremy.benoist@gmail.com>2016-03-27 20:54:57 +0200
commit4d0ec0e72108ff47952906e5d968a7c3eb0a76f9 (patch)
treeb8e9cd86010368631296c22a2352f5dbedb429a1 /src/Wallabag/CoreBundle/Command/InstallCommand.php
parent5d6f6f56a2a0f72a67c2d3f96eb61986cf821a1e (diff)
downloadwallabag-4d0ec0e72108ff47952906e5d968a7c3eb0a76f9.tar.gz
wallabag-4d0ec0e72108ff47952906e5d968a7c3eb0a76f9.tar.zst
wallabag-4d0ec0e72108ff47952906e5d968a7c3eb0a76f9.zip
Fix some Scrutinizer issues
Diffstat (limited to 'src/Wallabag/CoreBundle/Command/InstallCommand.php')
-rw-r--r--src/Wallabag/CoreBundle/Command/InstallCommand.php23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/Wallabag/CoreBundle/Command/InstallCommand.php b/src/Wallabag/CoreBundle/Command/InstallCommand.php
index c9dad0df..2d73a9ad 100644
--- a/src/Wallabag/CoreBundle/Command/InstallCommand.php
+++ b/src/Wallabag/CoreBundle/Command/InstallCommand.php
@@ -83,7 +83,8 @@ class InstallCommand extends ContainerAwareCommand
83 $help = 'Needs one of sqlite, mysql or pgsql PDO drivers'; 83 $help = 'Needs one of sqlite, mysql or pgsql PDO drivers';
84 } 84 }
85 85
86 $rows[] = array($label, $status, $help); 86 $rows = [];
87 $rows[] = [$label, $status, $help];
87 88
88 foreach ($this->functionExists as $functionRequired) { 89 foreach ($this->functionExists as $functionRequired) {
89 $label = '<comment>'.$functionRequired.'</comment>'; 90 $label = '<comment>'.$functionRequired.'</comment>';
@@ -97,12 +98,12 @@ class InstallCommand extends ContainerAwareCommand
97 $help = 'You need the '.$functionRequired.' function activated'; 98 $help = 'You need the '.$functionRequired.' function activated';
98 } 99 }
99 100
100 $rows[] = array($label, $status, $help); 101 $rows[] = [$label, $status, $help];
101 } 102 }
102 103
103 $table = new Table($this->defaultOutput); 104 $table = new Table($this->defaultOutput);
104 $table 105 $table
105 ->setHeaders(array('Checked', 'Status', 'Recommendation')) 106 ->setHeaders(['Checked', 'Status', 'Recommendation'])
106 ->setRows($rows) 107 ->setRows($rows)
107 ->render(); 108 ->render();
108 109
@@ -126,7 +127,7 @@ class InstallCommand extends ContainerAwareCommand
126 $this->defaultOutput->writeln('Droping database, creating database and schema, clearing the cache'); 127 $this->defaultOutput->writeln('Droping database, creating database and schema, clearing the cache');
127 128
128 $this 129 $this
129 ->runCommand('doctrine:database:drop', array('--force' => true)) 130 ->runCommand('doctrine:database:drop', ['--force' => true])
130 ->runCommand('doctrine:database:create') 131 ->runCommand('doctrine:database:create')
131 ->runCommand('doctrine:schema:create') 132 ->runCommand('doctrine:schema:create')
132 ->runCommand('cache:clear') 133 ->runCommand('cache:clear')
@@ -158,7 +159,7 @@ class InstallCommand extends ContainerAwareCommand
158 $this->defaultOutput->writeln('Droping database, creating database and schema'); 159 $this->defaultOutput->writeln('Droping database, creating database and schema');
159 160
160 $this 161 $this
161 ->runCommand('doctrine:database:drop', array('--force' => true)) 162 ->runCommand('doctrine:database:drop', ['--force' => true])
162 ->runCommand('doctrine:database:create') 163 ->runCommand('doctrine:database:create')
163 ->runCommand('doctrine:schema:create') 164 ->runCommand('doctrine:schema:create')
164 ; 165 ;
@@ -168,7 +169,7 @@ class InstallCommand extends ContainerAwareCommand
168 $this->defaultOutput->writeln('Droping schema and creating schema'); 169 $this->defaultOutput->writeln('Droping schema and creating schema');
169 170
170 $this 171 $this
171 ->runCommand('doctrine:schema:drop', array('--force' => true)) 172 ->runCommand('doctrine:schema:drop', ['--force' => true])
172 ->runCommand('doctrine:schema:create') 173 ->runCommand('doctrine:schema:create')
173 ; 174 ;
174 } 175 }
@@ -388,19 +389,19 @@ class InstallCommand extends ContainerAwareCommand
388 * @param string $command 389 * @param string $command
389 * @param array $parameters Parameters to this command (usually 'force' => true) 390 * @param array $parameters Parameters to this command (usually 'force' => true)
390 */ 391 */
391 protected function runCommand($command, $parameters = array()) 392 protected function runCommand($command, $parameters = [])
392 { 393 {
393 $parameters = array_merge( 394 $parameters = array_merge(
394 array('command' => $command), 395 ['command' => $command],
395 $parameters, 396 $parameters,
396 array( 397 [
397 '--no-debug' => true, 398 '--no-debug' => true,
398 '--env' => $this->defaultInput->getOption('env') ?: 'dev', 399 '--env' => $this->defaultInput->getOption('env') ?: 'dev',
399 ) 400 ]
400 ); 401 );
401 402
402 if ($this->defaultInput->getOption('no-interaction')) { 403 if ($this->defaultInput->getOption('no-interaction')) {
403 $parameters = array_merge($parameters, array('--no-interaction' => true)); 404 $parameters = array_merge($parameters, ['--no-interaction' => true]);
404 } 405 }
405 406
406 $this->getApplication()->setAutoExit(false); 407 $this->getApplication()->setAutoExit(false);