1 | <?php |
||
11 | class MigrateMakeCommand extends BaseCommand |
||
12 | { |
||
13 | /** |
||
14 | * The console command signature. |
||
15 | * |
||
16 | * @var string |
||
17 | */ |
||
18 | protected $signature = 'cray:migration {name : The name of the migration.} |
||
19 | {--create= : The table to be created.} |
||
20 | {--table= : The table to migrate.} |
||
21 | {--path= : The location where the migration file should be created.} |
||
22 | {--realpath : Indicate any provided migration file paths are pre-resolved absolute paths.} |
||
23 | {--fullpath : Output the full path of the migration}'; |
||
24 | |||
25 | /** |
||
26 | * The console command description. |
||
27 | * |
||
28 | * @var string |
||
29 | */ |
||
30 | protected $description = 'Create a new migration file'; |
||
31 | |||
32 | /** |
||
33 | * The migration creator instance. |
||
34 | * |
||
35 | * @var \Illuminate\Database\Migrations\MigrationCreator |
||
36 | */ |
||
37 | protected $creator; |
||
38 | |||
39 | /** |
||
40 | * The Composer instance. |
||
41 | * |
||
42 | * @var \Illuminate\Support\Composer |
||
43 | */ |
||
44 | protected $composer; |
||
45 | |||
46 | /** |
||
47 | * Create a new migration install command instance. |
||
48 | * |
||
49 | * @param \Illuminate\Database\Migrations\MigrationCreator $creator |
||
50 | * @param \Illuminate\Support\Composer $composer |
||
51 | * @return void |
||
|
|||
52 | */ |
||
53 | public function __construct(MigrationCreator $creator, Composer $composer) |
||
60 | |||
61 | /** |
||
62 | * Execute the console command. |
||
63 | * |
||
64 | * @return void |
||
65 | */ |
||
66 | public function handle() |
||
100 | |||
101 | /** |
||
102 | * Write the migration file to disk. |
||
103 | * |
||
104 | * @param string $name |
||
105 | * @param string $table |
||
106 | * @param bool $create |
||
107 | * @return string |
||
108 | */ |
||
109 | protected function writeMigration($name, $table, $create) |
||
121 | |||
122 | /** |
||
123 | * Get migration path (either specified by '--path' option or default location). |
||
124 | * |
||
125 | * @return string |
||
126 | */ |
||
127 | protected function getMigrationPath() |
||
137 | |||
138 | /** |
||
139 | * Determine if the given path(s) are pre-resolved "real" paths. |
||
140 | * |
||
141 | * @return bool |
||
142 | */ |
||
143 | protected function usingRealPath() |
||
147 | } |
||
148 |
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.