1 | <?php |
||
10 | class TranslateTableCommand extends BaseCommand |
||
11 | { |
||
12 | /** |
||
13 | * The console command signature. |
||
14 | * |
||
15 | * @var string |
||
16 | */ |
||
17 | protected $signature = 'translate:table {name : The name of the translate table.} |
||
18 | {--path= : The location where the migration file should be created.}'; |
||
19 | |||
20 | /** |
||
21 | * The console command description. |
||
22 | * |
||
23 | * @var string |
||
24 | */ |
||
25 | protected $description = 'Create a new translate migration file'; |
||
26 | |||
27 | /** |
||
28 | * The migration creator instance. |
||
29 | * |
||
30 | * @var \Illuminate\Database\Migrations\MigrationCreator |
||
31 | */ |
||
32 | protected $creator; |
||
33 | |||
34 | /** |
||
35 | * The Composer instance. |
||
36 | * |
||
37 | * @var \Illuminate\Support\Composer |
||
38 | */ |
||
39 | protected $composer; |
||
40 | |||
41 | /** |
||
42 | * Create a new migration install command instance. |
||
43 | * |
||
44 | * @param \Dimsav\Translatable\Console\MigrationCreator $creator |
||
45 | * @param \Illuminate\Support\Composer $composer |
||
46 | * @return void |
||
|
|||
47 | */ |
||
48 | public function __construct(MigrationCreator $creator, Composer $composer) |
||
55 | |||
56 | |||
57 | /** |
||
58 | * Execute the console command. |
||
59 | * |
||
60 | * @return void |
||
61 | */ |
||
62 | public function fire() |
||
80 | |||
81 | /** |
||
82 | * Get the translate table name. |
||
83 | * |
||
84 | * @param string $table |
||
85 | * @return string |
||
86 | */ |
||
87 | protected function getTableName($table) |
||
92 | |||
93 | /** |
||
94 | * Get the translate migration file name. |
||
95 | * |
||
96 | * @param string $name |
||
97 | * @return string |
||
98 | */ |
||
99 | protected function getMigrationName($name) |
||
103 | |||
104 | |||
105 | |||
106 | /** |
||
107 | * Write the migration file to disk. |
||
108 | * |
||
109 | * @param string $name |
||
110 | * @param string $table |
||
111 | * @param bool $create |
||
112 | * @return string |
||
113 | */ |
||
114 | protected function writeMigration($name, $table, $create) |
||
122 | |||
123 | /** |
||
124 | * Get migration path (either specified by '--path' option or default location). |
||
125 | * |
||
126 | * @return string |
||
127 | */ |
||
128 | protected function getMigrationPath() |
||
136 | } |
||
137 |
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.