@@ -268,6 +268,7 @@ |
||
268 | 268 | * Verify that the migration directory exists and is writable. |
269 | 269 | * |
270 | 270 | * @throws InvalidArgumentException |
271 | + * @param string $path |
|
271 | 272 | * @return void |
272 | 273 | */ |
273 | 274 | protected function verifyMigrationDirectory($path) |
@@ -1101,7 +1101,7 @@ |
||
1101 | 1101 | |
1102 | 1102 | /** |
1103 | 1103 | * Returns MySQL column types (inherited and MySQL specified). |
1104 | - * @return array |
|
1104 | + * @return string[] |
|
1105 | 1105 | */ |
1106 | 1106 | public function getColumnTypes() |
1107 | 1107 | { |
@@ -214,7 +214,7 @@ |
||
214 | 214 | /** |
215 | 215 | * Gets the command start time |
216 | 216 | * |
217 | - * @return int |
|
217 | + * @return double |
|
218 | 218 | */ |
219 | 219 | public function getCommandStartTime() |
220 | 220 | { |
@@ -475,6 +475,11 @@ discard block |
||
475 | 475 | $this->endCommandTimer(); |
476 | 476 | } |
477 | 477 | |
478 | + /** |
|
479 | + * @param string $tableName |
|
480 | + * @param string $columnName |
|
481 | + * @param string $newColumnName |
|
482 | + */ |
|
478 | 483 | protected function renameDefault($tableName, $columnName, $newColumnName) |
479 | 484 | { |
480 | 485 | $oldConstraintName = "DF_{$tableName}_{$columnName}"; |
@@ -492,6 +497,9 @@ discard block |
||
492 | 497 | )); |
493 | 498 | } |
494 | 499 | |
500 | + /** |
|
501 | + * @param string $tableName |
|
502 | + */ |
|
495 | 503 | public function changeDefault($tableName, Column $newColumn) |
496 | 504 | { |
497 | 505 | $constraintName = "DF_{$tableName}_{$newColumn->getName()}"; |
@@ -572,6 +580,10 @@ discard block |
||
572 | 580 | $this->endCommandTimer(); |
573 | 581 | } |
574 | 582 | |
583 | + /** |
|
584 | + * @param string $tableName |
|
585 | + * @param string $columnName |
|
586 | + */ |
|
575 | 587 | protected function dropDefaultConstraint($tableName, $columnName) |
576 | 588 | { |
577 | 589 | $defaultConstraint = $this->getDefaultConstraint($tableName, $columnName); |
@@ -1094,6 +1106,7 @@ discard block |
||
1094 | 1106 | * Gets the SqlServer Index Definition for an Index object. |
1095 | 1107 | * |
1096 | 1108 | * @param Index $index Index |
1109 | + * @param string $tableName |
|
1097 | 1110 | * @return string |
1098 | 1111 | */ |
1099 | 1112 | protected function getIndexSqlDefinition(Index $index, $tableName) |
@@ -1122,6 +1135,7 @@ discard block |
||
1122 | 1135 | * Gets the SqlServer Foreign Key Definition for an ForeignKey object. |
1123 | 1136 | * |
1124 | 1137 | * @param ForeignKey $foreignKey |
1138 | + * @param string $tableName |
|
1125 | 1139 | * @return string |
1126 | 1140 | */ |
1127 | 1141 | protected function getForeignKeySqlDefinition(ForeignKey $foreignKey, $tableName) |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | /** |
273 | 273 | * Gets an array of foreign keys waiting to be commited. |
274 | 274 | * |
275 | - * @return array|ForeignKey[] |
|
275 | + * @return ForeignKey[] |
|
276 | 276 | */ |
277 | 277 | public function getForeignKeys() |
278 | 278 | { |
@@ -451,7 +451,7 @@ discard block |
||
451 | 451 | /** |
452 | 452 | * Removes the given index from a table. |
453 | 453 | * |
454 | - * @param array $columns Columns |
|
454 | + * @param string[] $columns Columns |
|
455 | 455 | * @param array $options Options |
456 | 456 | * @return Table |
457 | 457 | */ |
@@ -491,8 +491,8 @@ discard block |
||
491 | 491 | * In $options you can specify on_delete|on_delete = cascade|no_action .., |
492 | 492 | * on_update, constraint = constraint name. |
493 | 493 | * |
494 | - * @param string|array $columns Columns |
|
495 | - * @param string|Table $referencedTable Referenced Table |
|
494 | + * @param string $columns Columns |
|
495 | + * @param string $referencedTable Referenced Table |
|
496 | 496 | * @param string|array $referencedColumns Referenced Columns |
497 | 497 | * @param array $options Options |
498 | 498 | * @return Table |
@@ -519,7 +519,7 @@ discard block |
||
519 | 519 | /** |
520 | 520 | * Removes the given foreign key from the table. |
521 | 521 | * |
522 | - * @param string|array $columns Column(s) |
|
522 | + * @param string $columns Column(s) |
|
523 | 523 | * @param null|string $constraint Constraint names |
524 | 524 | * @return Table |
525 | 525 | */ |
@@ -540,7 +540,7 @@ discard block |
||
540 | 540 | /** |
541 | 541 | * Checks to see if a foreign key exists. |
542 | 542 | * |
543 | - * @param string|array $columns Column(s) |
|
543 | + * @param string $columns Column(s) |
|
544 | 544 | * @param null|string $constraint Constraint names |
545 | 545 | * @return boolean |
546 | 546 | */ |
@@ -569,7 +569,7 @@ discard block |
||
569 | 569 | } |
570 | 570 | |
571 | 571 | /** |
572 | - * @param array $columns column names |
|
572 | + * @param string[] $columns column names |
|
573 | 573 | * @param $data array of data in the form : |
574 | 574 | * array( |
575 | 575 | * array("value1", "anotherValue1"), |
@@ -165,7 +165,7 @@ |
||
165 | 165 | * |
166 | 166 | * @param string $key |
167 | 167 | * @param string $value |
168 | - * @return object |
|
168 | + * @return TextWrapper |
|
169 | 169 | */ |
170 | 170 | public function setOption($key, $value) |
171 | 171 | { |
@@ -4,7 +4,6 @@ |
||
4 | 4 | |
5 | 5 | use Symfony\Component\Console\Tester\CommandTester; |
6 | 6 | use Symfony\Component\Console\Output\StreamOutput; |
7 | -use Phinx\Config\Config; |
|
8 | 7 | use Phinx\Console\Command\Init; |
9 | 8 | |
10 | 9 | class InitTest extends \PHPUnit_Framework_TestCase |
@@ -76,6 +76,10 @@ discard block |
||
76 | 76 | } |
77 | 77 | |
78 | 78 | // helper methods for easy mocking |
79 | + |
|
80 | + /** |
|
81 | + * @param string $expected_sql |
|
82 | + */ |
|
79 | 83 | private function assertExecuteSql($expected_sql) |
80 | 84 | { |
81 | 85 | $this->conn->expects($this->once()) |
@@ -83,6 +87,9 @@ discard block |
||
83 | 87 | ->with($this->equalTo($expected_sql)); |
84 | 88 | } |
85 | 89 | |
90 | + /** |
|
91 | + * @param \PHPUnit_Framework_TestResult $returnValue |
|
92 | + */ |
|
86 | 93 | private function assertQuerySql($expectedSql, $returnValue = null) |
87 | 94 | { |
88 | 95 | $expect = $this->conn->expects($this->once()) |
@@ -93,6 +100,9 @@ discard block |
||
93 | 100 | } |
94 | 101 | } |
95 | 102 | |
103 | + /** |
|
104 | + * @param string $expectedSql |
|
105 | + */ |
|
96 | 106 | private function assertFetchRowSql($expectedSql, $returnValue) |
97 | 107 | { |
98 | 108 | $this->result->expects($this->once()) |
@@ -27,6 +27,9 @@ |
||
27 | 27 | $this->manager = null; |
28 | 28 | } |
29 | 29 | |
30 | + /** |
|
31 | + * @param string $path |
|
32 | + */ |
|
30 | 33 | private function getCorrectedPath($path) |
31 | 34 | { |
32 | 35 | return str_replace('/', DIRECTORY_SEPARATOR, $path); |
@@ -4,7 +4,6 @@ |
||
4 | 4 | |
5 | 5 | use Symfony\Component\Console\Output\StreamOutput; |
6 | 6 | use Phinx\Config\Config; |
7 | -use Phinx\Db\Adapter\MysqlAdapter; |
|
8 | 7 | use Phinx\Migration\Manager; |
9 | 8 | use Phinx\Migration\Manager\Environment; |
10 | 9 |