Skip to content

Commit f841a26

Browse files
authored
Merge pull request #865 from cakephp/4.x-cleanup
Fix up deprecation warning.
2 parents 58b2b77 + 1e4a970 commit f841a26

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"cakephp/bake": "^3.0",
3232
"cakephp/cakephp": "^5.0.11",
3333
"cakephp/cakephp-codesniffer": "^5.0",
34-
"phpunit/phpunit": "^10.5.5 || ^11.1.3"
34+
"phpunit/phpunit": "^10.5.5 || ^11.1.3 || ^12.2.4"
3535
},
3636
"suggest": {
3737
"cakephp/bake": "If you want to generate migrations.",

src/Command/BakeSimpleMigrationCommand.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -221,16 +221,21 @@ public function buildOptionParser(ConsoleOptionParser $parser): ConsoleOptionPar
221221
)->addOption('no-test', [
222222
'boolean' => true,
223223
'help' => 'Do not generate a test skeleton.',
224-
])->addOption('force', [
225-
'short' => 'f',
226-
'boolean' => true,
227-
'help' => 'Force overwriting existing file if a migration already exists with the same name.',
228224
])->addOption('source', [
229225
'short' => 's',
230226
'default' => self::DEFAULT_MIGRATION_FOLDER,
231227
'help' => 'Name of the folder in which the migration should be saved.',
232228
]);
233229

230+
$options = $parser->options();
231+
if (!isset($options['force'])) {
232+
$parser->addOption('force', [
233+
'short' => 'f',
234+
'boolean' => true,
235+
'help' => 'Force overwriting existing file if a migration already exists with the same name.',
236+
]);
237+
}
238+
234239
return $parser;
235240
}
236241

0 commit comments

Comments
 (0)