@@ -99,7 +99,7 @@ |
||
| 99 | 99 | */ |
| 100 | 100 | private function getArgvArray() |
| 101 | 101 | { |
| 102 | - $argvArray = $_SERVER['argv']; |
|
| 102 | + $argvArray = $_SERVER[ 'argv' ]; |
|
| 103 | 103 | array_shift($argvArray); |
| 104 | 104 | |
| 105 | 105 | return $argvArray; |
@@ -69,29 +69,29 @@ |
||
| 69 | 69 | { |
| 70 | 70 | return [ |
| 71 | 71 | 'Common command flags', |
| 72 | - ['-q', 'Do not output any message'], |
|
| 73 | - ['-n', 'Do not ask any interactive question'], |
|
| 74 | - ['-v|vv|vvv', 'Verbosity of messages: normal|more verbose|debug'], |
|
| 72 | + [ '-q', 'Do not output any message' ], |
|
| 73 | + [ '-n', 'Do not ask any interactive question' ], |
|
| 74 | + [ '-v|vv|vvv', 'Verbosity of messages: normal|more verbose|debug' ], |
|
| 75 | 75 | 'Commands', |
| 76 | 76 | 'ZfPhinx create [-t TEMPLATE] [-l CLASS] MIGRATION' => 'Create a new migration', |
| 77 | - ['-t TEMPLATE', 'Use an alternative template'], |
|
| 78 | - ['-l CLASS', 'Use a class implementing "Phinx\Migration\CreationInterface" to generate the template'], |
|
| 79 | - ['MIGRATION', 'Unique migration name'], |
|
| 77 | + [ '-t TEMPLATE', 'Use an alternative template' ], |
|
| 78 | + [ '-l CLASS', 'Use a class implementing "Phinx\Migration\CreationInterface" to generate the template' ], |
|
| 79 | + [ 'MIGRATION', 'Unique migration name' ], |
|
| 80 | 80 | // 'help Displays help for a command', |
| 81 | 81 | // 'list Lists commands', |
| 82 | 82 | 'ZfPhinx migrate [-t TARGET] [-d DATE] -e ENVIRONMENT' => 'Migrate the database', |
| 83 | - ['-t TARGET', 'The version number to migrate to. Format: YYYYMMDDHHMMSS'], |
|
| 84 | - ['-d DATE', 'The date to migrate to. Format: YYYYMMDD'], |
|
| 85 | - ['-e ENVIRONMENT', 'The target environment'], |
|
| 83 | + [ '-t TARGET', 'The version number to migrate to. Format: YYYYMMDDHHMMSS' ], |
|
| 84 | + [ '-d DATE', 'The date to migrate to. Format: YYYYMMDD' ], |
|
| 85 | + [ '-e ENVIRONMENT', 'The target environment' ], |
|
| 86 | 86 | 'ZfPhinx rollback [-t TARGET] [-d DATE] -e ENVIRONMENT' => 'Rollback the last or to a specific migration', |
| 87 | - ['-t TARGET', 'The version number to rollback to. Format: YYYYMMDDHHMMSS'], |
|
| 88 | - ['-d DATE', 'The date to rollback to. Format: YYYYMMDD'], |
|
| 89 | - ['-e ENVIRONMENT', 'The target environment'], |
|
| 87 | + [ '-t TARGET', 'The version number to rollback to. Format: YYYYMMDDHHMMSS' ], |
|
| 88 | + [ '-d DATE', 'The date to rollback to. Format: YYYYMMDD' ], |
|
| 89 | + [ '-e ENVIRONMENT', 'The target environment' ], |
|
| 90 | 90 | 'ZfPhinx status [-f FORMAT] -e ENVIRONMENT' => 'Show migration status', |
| 91 | - ['-f FORMAT', 'The output format: text or json. Defaults to text'], |
|
| 92 | - ['-e ENVIRONMENT', 'The target environment'], |
|
| 91 | + [ '-f FORMAT', 'The output format: text or json. Defaults to text' ], |
|
| 92 | + [ '-e ENVIRONMENT', 'The target environment' ], |
|
| 93 | 93 | 'ZfPhinx test -e ENVIRONMENT' => 'Verify the configuration file', |
| 94 | - ['-e ENVIRONMENT', 'The target environment'], |
|
| 94 | + [ '-e ENVIRONMENT', 'The target environment' ], |
|
| 95 | 95 | ]; |
| 96 | 96 | } |
| 97 | 97 | |
@@ -46,11 +46,11 @@ discard block |
||
| 46 | 46 | { |
| 47 | 47 | $config = $container->get('Config'); |
| 48 | 48 | |
| 49 | - if (!(array_key_exists('zfphinx', $config) && is_array($config['zfphinx']))) { |
|
| 49 | + if (!(array_key_exists('zfphinx', $config) && is_array($config[ 'zfphinx' ]))) { |
|
| 50 | 50 | throw new Exception\RuntimeException('zfphinx config is not found'); |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | - return new Config($this->performConfig($container, $config['zfphinx'])); |
|
| 53 | + return new Config($this->performConfig($container, $config[ 'zfphinx' ])); |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | /** |
@@ -62,15 +62,15 @@ discard block |
||
| 62 | 62 | */ |
| 63 | 63 | private function performConfig(ContainerInterface $container, array $config) |
| 64 | 64 | { |
| 65 | - if (!(array_key_exists('environments', $config) && is_array($config['environments']))) { |
|
| 65 | + if (!(array_key_exists('environments', $config) && is_array($config[ 'environments' ]))) { |
|
| 66 | 66 | throw new Exception\RuntimeException('zfphinx environment config is not found'); |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | array_walk( |
| 70 | - $config['environments'], |
|
| 71 | - function (&$element, $key) use ($container) { |
|
| 70 | + $config[ 'environments' ], |
|
| 71 | + function(&$element, $key) use ($container) { |
|
| 72 | 72 | if (is_array($element) && array_key_exists('db_adapter', $element)) { |
| 73 | - if (!$container->has($element['db_adapter'])) { |
|
| 73 | + if (!$container->has($element[ 'db_adapter' ])) { |
|
| 74 | 74 | $message = sprintf( |
| 75 | 75 | 'Adapter for environment %s is not found', |
| 76 | 76 | $key |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | throw new Exception\RuntimeException($message); |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | - $adapter = $container->get($element['db_adapter']); |
|
| 81 | + $adapter = $container->get($element[ 'db_adapter' ]); |
|
| 82 | 82 | |
| 83 | 83 | if (!$adapter instanceof AdapterInterface) { |
| 84 | 84 | $message = sprintf( |
@@ -94,8 +94,8 @@ discard block |
||
| 94 | 94 | ->getDriver() |
| 95 | 95 | ->getConnection(); |
| 96 | 96 | |
| 97 | - $element['connection'] = $connection->getResource(); |
|
| 98 | - $element['name'] = $connection->getCurrentSchema(); |
|
| 97 | + $element[ 'connection' ] = $connection->getResource(); |
|
| 98 | + $element[ 'name' ] = $connection->getCurrentSchema(); |
|
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | return $element; |