@@ -27,8 +27,8 @@ |
||
27 | 27 | parent::execute($input, $output); |
28 | 28 | try { |
29 | 29 | $versionInfo = $this->migration->getCurrentVersion(); |
30 | - $output->writeln('version: ' . $versionInfo['version']); |
|
31 | - $output->writeln('status.: ' . $versionInfo['status']); |
|
30 | + $output->writeln('version: ' . $versionInfo[ 'version' ]); |
|
31 | + $output->writeln('status.: ' . $versionInfo[ 'status' ]); |
|
32 | 32 | } catch (\Exception $ex) { |
33 | 33 | $this->handleError($ex, $output); |
34 | 34 | } |
@@ -27,7 +27,7 @@ |
||
27 | 27 | { |
28 | 28 | try { |
29 | 29 | $versionInfo = $this->migration->getCurrentVersion(); |
30 | - if (strpos($versionInfo['status'], 'partial') !== false) { |
|
30 | + if (strpos($versionInfo[ 'status' ], 'partial') !== false) { |
|
31 | 31 | $helper = $this->getHelper('question'); |
32 | 32 | $question = new ConfirmationQuestion( |
33 | 33 | 'The database was not fully updated and maybe be unstable. Did you really want migrate the version? (y/N)', |
@@ -29,7 +29,7 @@ |
||
29 | 29 | { |
30 | 30 | try { |
31 | 31 | $versionInfo = $this->migration->getCurrentVersion(); |
32 | - if (strpos($versionInfo['status'], 'partial') !== false) { |
|
32 | + if (strpos($versionInfo[ 'status' ], 'partial') !== false) { |
|
33 | 33 | $helper = $this->getHelper('question'); |
34 | 34 | $question = new ConfirmationQuestion( |
35 | 35 | 'The database was not fully updated and maybe be unstable. Did you really want migrate the version? (y/N) ', |
@@ -42,8 +42,8 @@ |
||
42 | 42 | |
43 | 43 | $version = $this->migration->getCurrentVersion(); |
44 | 44 | $output->writeln($action); |
45 | - $output->writeln('current version: ' . $version['version']); |
|
46 | - $output->writeln('current status.: ' . $version['status']); |
|
45 | + $output->writeln('current version: ' . $version[ 'version' ]); |
|
46 | + $output->writeln('current status.: ' . $version[ 'status' ]); |
|
47 | 47 | } catch (\Exception $ex) { |
48 | 48 | $this->handleError($ex, $output); |
49 | 49 | } |
@@ -25,7 +25,7 @@ |
||
25 | 25 | { |
26 | 26 | $currentDbName = $dbDriver->getScalar( |
27 | 27 | "SELECT datname FROM pg_catalog.pg_database WHERE lower(datname) = lower(:dbname)", |
28 | - ['dbname' => $database] |
|
28 | + [ 'dbname' => $database ] |
|
29 | 29 | ); |
30 | 30 | |
31 | 31 | if (empty($currentDbName)) { |
@@ -75,5 +75,5 @@ |
||
75 | 75 | $this->getDbDriver()->execute('drop table migration_version'); |
76 | 76 | $this->createVersion(); |
77 | 77 | $this->setVersion($currentVersion, 'unknow'); |
78 | - } |
|
78 | + } |
|
79 | 79 | } |
@@ -33,15 +33,15 @@ discard block |
||
33 | 33 | |
34 | 34 | public function getVersion() |
35 | 35 | { |
36 | - $result = []; |
|
36 | + $result = [ ]; |
|
37 | 37 | try { |
38 | - $result['version'] = $this->getDbDriver()->getScalar('SELECT version FROM migration_version'); |
|
38 | + $result[ 'version' ] = $this->getDbDriver()->getScalar('SELECT version FROM migration_version'); |
|
39 | 39 | } catch (\Exception $ex) { |
40 | 40 | throw new DatabaseNotVersionedException('This database does not have a migration version. Please use "migrate reset" or "migrate install" to create one.'); |
41 | 41 | } |
42 | 42 | |
43 | 43 | try { |
44 | - $result['status'] = $this->getDbDriver()->getScalar('SELECT status FROM migration_version'); |
|
44 | + $result[ 'status' ] = $this->getDbDriver()->getScalar('SELECT status FROM migration_version'); |
|
45 | 45 | } catch (\Exception $ex) { |
46 | 46 | throw new OldVersionSchemaException('This database does not have a migration version. Please use "migrate install" for update it.'); |
47 | 47 | } |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | { |
65 | 65 | // Get the version to check if exists |
66 | 66 | $versionInfo = $this->getVersion(); |
67 | - if (empty($versionInfo['version'])) { |
|
67 | + if (empty($versionInfo[ 'version' ])) { |
|
68 | 68 | $this->getDbDriver()->execute("insert into migration_version values(0, 'unknow')"); |
69 | 69 | } |
70 | 70 | } |
@@ -67,16 +67,16 @@ discard block |
||
67 | 67 | protected function getExpectedUsersVersion0() |
68 | 68 | { |
69 | 69 | return [ |
70 | - ["id" => 1, "name" => 'John Doe', 'createdate' => '20160110'], |
|
71 | - ["id" => 2, "name" => 'Jane Doe', 'createdate' => '20151230'] |
|
70 | + [ "id" => 1, "name" => 'John Doe', 'createdate' => '20160110' ], |
|
71 | + [ "id" => 2, "name" => 'Jane Doe', 'createdate' => '20151230' ] |
|
72 | 72 | ]; |
73 | 73 | } |
74 | 74 | |
75 | 75 | protected function getExpectedUsersVersion1() |
76 | 76 | { |
77 | 77 | return [ |
78 | - ["id" => 1, "name" => 'John Doe', 'createdate' => '2016-01-10'], |
|
79 | - ["id" => 2, "name" => 'Jane Doe', 'createdate' => '2015-12-30'] |
|
78 | + [ "id" => 1, "name" => 'John Doe', 'createdate' => '2016-01-10' ], |
|
79 | + [ "id" => 2, "name" => 'Jane Doe', 'createdate' => '2015-12-30' ] |
|
80 | 80 | ]; |
81 | 81 | } |
82 | 82 | |
@@ -90,14 +90,14 @@ discard block |
||
90 | 90 | $this->assertTrue($iterator->hasNext()); |
91 | 91 | $row = $iterator->moveNext(); |
92 | 92 | $this->assertEquals( |
93 | - $this->getExpectedUsersVersion0()[0], |
|
93 | + $this->getExpectedUsersVersion0()[ 0 ], |
|
94 | 94 | $row->toArray() |
95 | 95 | ); |
96 | 96 | |
97 | 97 | $this->assertTrue($iterator->hasNext()); |
98 | 98 | $row = $iterator->moveNext(); |
99 | 99 | $this->assertEquals( |
100 | - $this->getExpectedUsersVersion0()[1], |
|
100 | + $this->getExpectedUsersVersion0()[ 1 ], |
|
101 | 101 | $row->toArray() |
102 | 102 | ); |
103 | 103 | |
@@ -120,14 +120,14 @@ discard block |
||
120 | 120 | $this->assertTrue($iterator->hasNext()); |
121 | 121 | $row = $iterator->moveNext(); |
122 | 122 | $this->assertEquals( |
123 | - $this->getExpectedUsersVersion1()[0], |
|
123 | + $this->getExpectedUsersVersion1()[ 0 ], |
|
124 | 124 | $row->toArray() |
125 | 125 | ); |
126 | 126 | |
127 | 127 | $this->assertTrue($iterator->hasNext()); |
128 | 128 | $row = $iterator->moveNext(); |
129 | 129 | $this->assertEquals( |
130 | - $this->getExpectedUsersVersion1()[1], |
|
130 | + $this->getExpectedUsersVersion1()[ 1 ], |
|
131 | 131 | $row->toArray() |
132 | 132 | ); |
133 | 133 | |
@@ -150,14 +150,14 @@ discard block |
||
150 | 150 | $this->assertTrue($iterator->hasNext()); |
151 | 151 | $row = $iterator->moveNext(); |
152 | 152 | $this->assertEquals( |
153 | - $this->getExpectedUsersVersion1()[0], |
|
153 | + $this->getExpectedUsersVersion1()[ 0 ], |
|
154 | 154 | $row->toArray() |
155 | 155 | ); |
156 | 156 | |
157 | 157 | $this->assertTrue($iterator->hasNext()); |
158 | 158 | $row = $iterator->moveNext(); |
159 | 159 | $this->assertEquals( |
160 | - $this->getExpectedUsersVersion1()[1], |
|
160 | + $this->getExpectedUsersVersion1()[ 1 ], |
|
161 | 161 | $row->toArray() |
162 | 162 | ); |
163 | 163 |
@@ -14,8 +14,8 @@ |
||
14 | 14 | public function getExpectedUsersVersion1() |
15 | 15 | { |
16 | 16 | return [ |
17 | - ["id" => 1, "name" => 'John Doe', 'createdate' => 'Jan 10 2016 12:00:00:AM'], |
|
18 | - ["id" => 2, "name" => 'Jane Doe', 'createdate' => 'Dec 30 2015 12:00:00:AM'] |
|
17 | + [ "id" => 1, "name" => 'John Doe', 'createdate' => 'Jan 10 2016 12:00:00:AM' ], |
|
18 | + [ "id" => 2, "name" => 'Jane Doe', 'createdate' => 'Dec 30 2015 12:00:00:AM' ] |
|
19 | 19 | ]; |
20 | 20 | } |
21 | 21 |
@@ -29,7 +29,7 @@ |
||
29 | 29 | { |
30 | 30 | try { |
31 | 31 | $versionInfo = $this->migration->getCurrentVersion(); |
32 | - if (strpos($versionInfo['status'], 'partial') !== false) { |
|
32 | + if (strpos($versionInfo[ 'status' ], 'partial') !== false) { |
|
33 | 33 | $helper = $this->getHelper('question'); |
34 | 34 | $question = new ConfirmationQuestion( |
35 | 35 | 'The database was not fully updated and maybe be unstable. Did you really want migrate the version? (y/N) ', |