@@ -92,7 +92,7 @@ public function __construct(Intent $intent)
92
92
* @param \Phinx\Db\Action\Action[] $actions The actions to use for the plan
93
93
* @return void
94
94
*/
95
- protected function createPlan ($ actions )
95
+ protected function createPlan (array $ actions ): void
96
96
{
97
97
$ this ->gatherCreates ($ actions );
98
98
$ this ->gatherUpdates ($ actions );
@@ -107,7 +107,7 @@ protected function createPlan($actions)
107
107
*
108
108
* @return \Phinx\Db\Plan\AlterTable[][]
109
109
*/
110
- protected function updatesSequence ()
110
+ protected function updatesSequence (): array
111
111
{
112
112
return [
113
113
$ this ->tableUpdates ,
@@ -123,7 +123,7 @@ protected function updatesSequence()
123
123
*
124
124
* @return \Phinx\Db\Plan\AlterTable[][]
125
125
*/
126
- protected function inverseUpdatesSequence ()
126
+ protected function inverseUpdatesSequence (): array
127
127
{
128
128
return [
129
129
$ this ->constraints ,
@@ -140,7 +140,7 @@ protected function inverseUpdatesSequence()
140
140
* @param \Phinx\Db\Adapter\AdapterInterface $executor The executor object for the plan
141
141
* @return void
142
142
*/
143
- public function execute (AdapterInterface $ executor )
143
+ public function execute (AdapterInterface $ executor ): void
144
144
{
145
145
foreach ($ this ->tableCreates as $ newTable ) {
146
146
$ executor ->createTable ($ newTable ->getTable (), $ newTable ->getColumns (), $ newTable ->getIndexes ());
@@ -159,7 +159,7 @@ public function execute(AdapterInterface $executor)
159
159
* @param \Phinx\Db\Adapter\AdapterInterface $executor The executor object for the plan
160
160
* @return void
161
161
*/
162
- public function executeInverse (AdapterInterface $ executor )
162
+ public function executeInverse (AdapterInterface $ executor ): void
163
163
{
164
164
foreach ($ this ->inverseUpdatesSequence () as $ updates ) {
165
165
foreach ($ updates as $ update ) {
@@ -177,7 +177,7 @@ public function executeInverse(AdapterInterface $executor)
177
177
*
178
178
* @return void
179
179
*/
180
- protected function resolveConflicts ()
180
+ protected function resolveConflicts (): void
181
181
{
182
182
foreach ($ this ->tableMoves as $ alterTable ) {
183
183
foreach ($ alterTable ->getActions () as $ action ) {
@@ -251,7 +251,7 @@ function (DropForeignKey $a, AddForeignKey $b) {
251
251
* @param \Phinx\Db\Plan\AlterTable[] $actions The actions to transform
252
252
* @return \Phinx\Db\Plan\AlterTable[] The list of actions without actions for the given table
253
253
*/
254
- protected function forgetTable (Table $ table , $ actions )
254
+ protected function forgetTable (Table $ table , array $ actions ): array
255
255
{
256
256
$ result = [];
257
257
foreach ($ actions as $ action ) {
@@ -273,7 +273,7 @@ protected function forgetTable(Table $table, $actions)
273
273
* @return \Phinx\Db\Plan\AlterTable The updated AlterTable object. This function
274
274
* has the side effect of changing the `$this->indexes` property.
275
275
*/
276
- protected function remapContraintAndIndexConflicts (AlterTable $ alter )
276
+ protected function remapContraintAndIndexConflicts (AlterTable $ alter ): AlterTable
277
277
{
278
278
$ newAlter = new AlterTable ($ alter ->getTable ());
279
279
@@ -303,7 +303,7 @@ protected function remapContraintAndIndexConflicts(AlterTable $alter)
303
303
* @return array A tuple containing the list of actions without actions for dropping the index
304
304
* and a list of drop index actions that were removed.
305
305
*/
306
- protected function forgetDropIndex (Table $ table , array $ columns , array $ actions )
306
+ protected function forgetDropIndex (Table $ table , array $ columns , array $ actions ): array
307
307
{
308
308
$ dropIndexActions = new ArrayObject ();
309
309
$ indexes = array_map (function ($ alter ) use ($ table , $ columns , $ dropIndexActions ) {
@@ -335,7 +335,7 @@ protected function forgetDropIndex(Table $table, array $columns, array $actions)
335
335
* @return array A tuple containing the list of actions without actions for removing the column
336
336
* and a list of remove column actions that were removed.
337
337
*/
338
- protected function forgetRemoveColumn (Table $ table , array $ columns , array $ actions )
338
+ protected function forgetRemoveColumn (Table $ table , array $ columns , array $ actions ): array
339
339
{
340
340
$ removeColumnActions = new ArrayObject ();
341
341
$ indexes = array_map (function ($ alter ) use ($ table , $ columns , $ removeColumnActions ) {
@@ -364,7 +364,7 @@ protected function forgetRemoveColumn(Table $table, array $columns, array $actio
364
364
* @param \Phinx\Db\Action\Action[] $actions The actions to parse
365
365
* @return void
366
366
*/
367
- protected function gatherCreates ($ actions )
367
+ protected function gatherCreates (array $ actions ): void
368
368
{
369
369
foreach ($ actions as $ action ) {
370
370
if ($ action instanceof CreateTable) {
@@ -396,7 +396,7 @@ protected function gatherCreates($actions)
396
396
* @param \Phinx\Db\Action\Action[] $actions The actions to parse
397
397
* @return void
398
398
*/
399
- protected function gatherUpdates ($ actions )
399
+ protected function gatherUpdates (array $ actions ): void
400
400
{
401
401
foreach ($ actions as $ action ) {
402
402
if (
@@ -432,7 +432,7 @@ protected function gatherUpdates($actions)
432
432
* @param \Phinx\Db\Action\Action[] $actions The actions to parse
433
433
* @return void
434
434
*/
435
- protected function gatherTableMoves ($ actions )
435
+ protected function gatherTableMoves (array $ actions ): void
436
436
{
437
437
foreach ($ actions as $ action ) {
438
438
if (
@@ -460,7 +460,7 @@ protected function gatherTableMoves($actions)
460
460
* @param \Phinx\Db\Action\Action[] $actions The actions to parse
461
461
* @return void
462
462
*/
463
- protected function gatherIndexes ($ actions )
463
+ protected function gatherIndexes (array $ actions ): void
464
464
{
465
465
foreach ($ actions as $ action ) {
466
466
if (!($ action instanceof AddIndex) && !($ action instanceof DropIndex)) {
@@ -486,7 +486,7 @@ protected function gatherIndexes($actions)
486
486
* @param \Phinx\Db\Action\Action[] $actions The actions to parse
487
487
* @return void
488
488
*/
489
- protected function gatherConstraints ($ actions )
489
+ protected function gatherConstraints (array $ actions ): void
490
490
{
491
491
foreach ($ actions as $ action ) {
492
492
if (!($ action instanceof AddForeignKey || $ action instanceof DropForeignKey)) {
0 commit comments