1 | <?php |
||
11 | class ModuleMakeMigration extends BaseCommand |
||
12 | { |
||
13 | use ModuleVerification; |
||
14 | use Replacer; |
||
15 | use ModuleCreator; |
||
16 | |||
17 | /** |
||
18 | * The name and signature of the console command. |
||
19 | * |
||
20 | * @var string |
||
21 | */ |
||
22 | protected $signature = 'module:make-migration |
||
23 | {module : Module name} |
||
24 | {name : Migration full name (ex. create_users_table)} |
||
25 | {--type= : Type of migration (default options: create, edit)} |
||
26 | {--table= : Table name (use with --type)} |
||
27 | {--group= : Stub group name that will be used for creating this migration}'; |
||
28 | |||
29 | /** |
||
30 | * The console command description. |
||
31 | * |
||
32 | * @var string |
||
33 | */ |
||
34 | protected $description = 'Create migration in selected module'; |
||
35 | |||
36 | /** |
||
37 | * {@inheritdoc} |
||
38 | */ |
||
39 | public function proceed() |
||
56 | |||
57 | /** |
||
58 | * Create migration file |
||
59 | * |
||
60 | * @param Module $module |
||
61 | * @param string $name |
||
62 | * @param string $type |
||
63 | * @param string $table |
||
64 | * |
||
65 | * @throws Exception |
||
66 | */ |
||
67 | protected function createMigrationFile(Module $module, $name, $type, $table) |
||
92 | |||
93 | /** |
||
94 | * Get migration file name based on user given migration name |
||
95 | * |
||
96 | * @param string $name |
||
97 | * |
||
98 | * @return string |
||
99 | */ |
||
100 | protected function getMigrationFileName($name) |
||
104 | } |
||
105 |
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.