1 | <?php |
||
16 | class PublishCommand extends AbstractCommand |
||
17 | { |
||
18 | /* ----------------------------------------------------------------- |
||
19 | | Properties |
||
20 | | ----------------------------------------------------------------- |
||
21 | */ |
||
22 | |||
23 | /** |
||
24 | * The name and signature of the console command. |
||
25 | * |
||
26 | * @var string |
||
27 | */ |
||
28 | protected $signature = 'trans:publish |
||
29 | {locale : The language to publish the translations.} |
||
30 | {--force : Force to override the translations} |
||
31 | {--inline : Publish the inline translations}'; |
||
32 | |||
33 | /** |
||
34 | * The console command description. |
||
35 | * |
||
36 | * @var string |
||
37 | */ |
||
38 | protected $description = 'Publish the [locale] translations.'; |
||
39 | |||
40 | /** |
||
41 | * The TransPublisher instance. |
||
42 | * |
||
43 | * @var \Arcanedev\LaravelLang\Contracts\TransPublisher |
||
44 | */ |
||
45 | private $publisher; |
||
46 | |||
47 | /* ----------------------------------------------------------------- |
||
48 | | Constructor |
||
49 | | ----------------------------------------------------------------- |
||
50 | */ |
||
51 | |||
52 | /** |
||
53 | * Create a new console command instance. |
||
54 | * |
||
55 | * @param \Arcanedev\LaravelLang\Contracts\TransPublisher $publisher |
||
56 | */ |
||
57 | 42 | public function __construct(TransPublisher $publisher) |
|
64 | |||
65 | /* ----------------------------------------------------------------- |
||
66 | | Main Methods |
||
67 | | ----------------------------------------------------------------- |
||
68 | */ |
||
69 | |||
70 | /** |
||
71 | * Execute the console command. |
||
72 | */ |
||
73 | 30 | public function handle(): void |
|
92 | |||
93 | /* ----------------------------------------------------------------- |
||
94 | | Other Methods |
||
95 | | ----------------------------------------------------------------- |
||
96 | */ |
||
97 | |||
98 | /** |
||
99 | * Publish the translations. |
||
100 | * |
||
101 | * @param string $locale |
||
102 | * @param array $options |
||
103 | */ |
||
104 | 24 | private function publish(string $locale, array $options): void |
|
113 | |||
114 | /** |
||
115 | * Show the results. |
||
116 | * |
||
117 | * @param array $headers |
||
118 | * @param array $results |
||
119 | */ |
||
120 | 24 | public function showResults(array $headers, array $results): void |
|
129 | } |
||
130 |