1 | <?php |
||
14 | class CheckCommand extends AbstractCommand |
||
15 | { |
||
16 | /* ----------------------------------------------------------------- |
||
17 | | Properties |
||
18 | | ----------------------------------------------------------------- |
||
19 | */ |
||
20 | |||
21 | /** |
||
22 | * The name and signature of the console command. |
||
23 | * |
||
24 | * @var string |
||
25 | */ |
||
26 | protected $signature = 'trans:check'; |
||
27 | |||
28 | /** |
||
29 | * The console command description. |
||
30 | * |
||
31 | * @var string |
||
32 | */ |
||
33 | protected $description = 'Check the missing translations.'; |
||
34 | |||
35 | /** |
||
36 | * The TransChecker instance. |
||
37 | * |
||
38 | * @var \Arcanedev\LaravelLang\Contracts\TransChecker |
||
39 | */ |
||
40 | private $checker; |
||
41 | |||
42 | /** |
||
43 | * Missing translations count. |
||
44 | * |
||
45 | * @var int |
||
46 | */ |
||
47 | private $missingTranslations = 0; |
||
48 | |||
49 | /* ----------------------------------------------------------------- |
||
50 | | Constructor |
||
51 | | ----------------------------------------------------------------- |
||
52 | */ |
||
53 | |||
54 | /** |
||
55 | * Init the CheckCommand. |
||
56 | * |
||
57 | * @param \Arcanedev\LaravelLang\Contracts\TransChecker $checker |
||
58 | */ |
||
59 | 48 | public function __construct(TransChecker $checker) |
|
67 | |||
68 | /* ----------------------------------------------------------------- |
||
69 | | Main Methods |
||
70 | | ----------------------------------------------------------------- |
||
71 | */ |
||
72 | |||
73 | /** |
||
74 | * Execute the console command. |
||
75 | */ |
||
76 | 12 | public function handle(): int |
|
93 | |||
94 | /* ----------------------------------------------------------------- |
||
95 | | Other Methods |
||
96 | | ----------------------------------------------------------------- |
||
97 | */ |
||
98 | |||
99 | /** |
||
100 | * Prepare table rows. |
||
101 | * |
||
102 | * @param array $missing |
||
103 | * |
||
104 | * @return array |
||
105 | */ |
||
106 | 12 | private function prepareRows(array $missing): array |
|
122 | |||
123 | /** |
||
124 | * Show the message. |
||
125 | * |
||
126 | * @codeCoverageIgnore |
||
127 | */ |
||
128 | private function showMessage(): void |
||
135 | |||
136 | /** |
||
137 | * Get the exit code. |
||
138 | * |
||
139 | * @return int |
||
140 | */ |
||
141 | 12 | protected function getExitCode(): int |
|
145 | |||
146 | /** |
||
147 | * Check if has missing translations. |
||
148 | * |
||
149 | * @return bool |
||
150 | */ |
||
151 | 12 | protected function hasMissingTranslations(): bool |
|
155 | } |
||
156 |