@@ -1,3 +1,3 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -require_once __DIR__.'src/ZfPhinx/Module.php'; |
|
3 | +require_once __DIR__ . 'src/ZfPhinx/Module.php'; |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | */ |
41 | 41 | public function getConfig() |
42 | 42 | { |
43 | - return include __DIR__.'/../../config/module.config.php'; |
|
43 | + return include __DIR__ . '/../../config/module.config.php'; |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | /** |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | return [ |
54 | 54 | 'Zend\Loader\StandardAutoloader' => [ |
55 | 55 | 'namespaces' => [ |
56 | - __NAMESPACE__ => __DIR__.'/src/'.__NAMESPACE__, |
|
56 | + __NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__, |
|
57 | 57 | ], |
58 | 58 | ], |
59 | 59 | ]; |
@@ -69,14 +69,14 @@ discard block |
||
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'], |
|
72 | + ['-q', 'Do not output any message'], |
|
73 | + ['-n', 'Do not ask any interactive question'], |
|
74 | 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 | 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'], |
|
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', |
@@ -103,6 +103,6 @@ discard block |
||
103 | 103 | */ |
104 | 104 | public function getConsoleBanner(Console $console) |
105 | 105 | { |
106 | - return self::MODULE_NAME.' '.self::MODULE_VERSION; |
|
106 | + return self::MODULE_NAME . ' ' . self::MODULE_VERSION; |
|
107 | 107 | } |
108 | 108 | } |
@@ -46,7 +46,7 @@ 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 | |
@@ -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 | 70 | $config['environments'], |
71 | - function (&$element, $key) use ($container) { |
|
72 | - if (is_array($element) && array_key_exists('db_adapter', $element)) { |
|
73 | - if (!$container->has($element['db_adapter'])) { |
|
71 | + function(&$element, $key) use ($container) { |
|
72 | + if(is_array($element) && array_key_exists('db_adapter', $element)){ |
|
73 | + if(!$container->has($element['db_adapter'])){ |
|
74 | 74 | $message = sprintf( |
75 | 75 | 'Adapter for environment %s is not found', |
76 | 76 | $key |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | |
81 | 81 | $adapter = $container->get($element['db_adapter']); |
82 | 82 | |
83 | - if (!$adapter instanceof AdapterInterface) { |
|
83 | + if(!$adapter instanceof AdapterInterface){ |
|
84 | 84 | $message = sprintf( |
85 | 85 | 'Adapter for environment %s must implement %s; %s given', |
86 | 86 | $key, |
@@ -46,7 +46,8 @@ 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 | 51 | throw new Exception\RuntimeException('zfphinx config is not found'); |
51 | 52 | } |
52 | 53 | |
@@ -62,15 +63,19 @@ discard block |
||
62 | 63 | */ |
63 | 64 | private function performConfig(ContainerInterface $container, array $config) |
64 | 65 | { |
65 | - if (!(array_key_exists('environments', $config) && is_array($config['environments']))) { |
|
66 | + if (!(array_key_exists('environments', $config) && is_array($config['environments']))) |
|
67 | + { |
|
66 | 68 | throw new Exception\RuntimeException('zfphinx environment config is not found'); |
67 | 69 | } |
68 | 70 | |
69 | 71 | array_walk( |
70 | 72 | $config['environments'], |
71 | - function (&$element, $key) use ($container) { |
|
72 | - if (is_array($element) && array_key_exists('db_adapter', $element)) { |
|
73 | - if (!$container->has($element['db_adapter'])) { |
|
73 | + function (&$element, $key) use ($container) |
|
74 | + { |
|
75 | + if (is_array($element) && array_key_exists('db_adapter', $element)) |
|
76 | + { |
|
77 | + if (!$container->has($element['db_adapter'])) |
|
78 | + { |
|
74 | 79 | $message = sprintf( |
75 | 80 | 'Adapter for environment %s is not found', |
76 | 81 | $key |
@@ -80,7 +85,8 @@ discard block |
||
80 | 85 | |
81 | 86 | $adapter = $container->get($element['db_adapter']); |
82 | 87 | |
83 | - if (!$adapter instanceof AdapterInterface) { |
|
88 | + if (!$adapter instanceof AdapterInterface) |
|
89 | + { |
|
84 | 90 | $message = sprintf( |
85 | 91 | 'Adapter for environment %s must implement %s; %s given', |
86 | 92 | $key, |
@@ -28,8 +28,8 @@ |
||
28 | 28 | $this->verifyMigrationDirectory($this->getConfig()->getMigrationPath()); |
29 | 29 | |
30 | 30 | $envName = $input->getOption('environment'); |
31 | - if ($envName) { |
|
32 | - if (!$this->getConfig()->hasEnvironment($envName)) { |
|
31 | + if($envName){ |
|
32 | + if(!$this->getConfig()->hasEnvironment($envName)){ |
|
33 | 33 | throw new \InvalidArgumentException(sprintf( |
34 | 34 | 'The environment "%s" does not exist', |
35 | 35 | $envName |
@@ -28,8 +28,10 @@ |
||
28 | 28 | $this->verifyMigrationDirectory($this->getConfig()->getMigrationPath()); |
29 | 29 | |
30 | 30 | $envName = $input->getOption('environment'); |
31 | - if ($envName) { |
|
32 | - if (!$this->getConfig()->hasEnvironment($envName)) { |
|
31 | + if ($envName) |
|
32 | + { |
|
33 | + if (!$this->getConfig()->hasEnvironment($envName)) |
|
34 | + { |
|
33 | 35 | throw new \InvalidArgumentException(sprintf( |
34 | 36 | 'The environment "%s" does not exist', |
35 | 37 | $envName |