| 1 |  |  | <?php | 
            
                                                                                                            
                            
            
                                    
            
            
                | 2 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 3 |  |  | namespace Helldar\LaravelLangPublisher\Console; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 4 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 5 |  |  | use Helldar\LaravelLangPublisher\Concerns\Containable; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 6 |  |  | use Helldar\LaravelLangPublisher\Concerns\Logger; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 7 |  |  | use Helldar\LaravelLangPublisher\Concerns\Pathable; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 8 |  |  | use Helldar\LaravelLangPublisher\Constants\Locales as LocalesList; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 9 |  |  | use Helldar\LaravelLangPublisher\Contracts\Actionable; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 10 |  |  | use Helldar\LaravelLangPublisher\Contracts\Processor; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 11 |  |  | use Helldar\LaravelLangPublisher\Facades\Config; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 12 |  |  | use Helldar\LaravelLangPublisher\Facades\Locales; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 13 |  |  | use Helldar\LaravelLangPublisher\Facades\Message; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 14 |  |  | use Helldar\LaravelLangPublisher\Facades\Packages; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 15 |  |  | use Helldar\LaravelLangPublisher\Facades\Validator; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 16 |  |  | use Helldar\LaravelLangPublisher\Services\Command\Locales as LocalesSupport; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 17 |  |  | use Helldar\Support\Facades\Helpers\Arr; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 18 |  |  | use Helldar\Support\Facades\Helpers\Filesystem\File; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 19 |  |  | use Helldar\Support\Facades\Helpers\Str; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 20 |  |  | use Illuminate\Console\Command; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 21 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 22 |  |  | abstract class BaseCommand extends Command | 
            
                                                                                                            
                            
            
                                    
            
            
                | 23 |  |  | { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 24 |  |  |     use Containable; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 25 |  |  |     use Logger; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 26 |  |  |     use Pathable; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 27 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 28 |  |  |     protected $action; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 29 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 30 |  |  |     protected $locales_length = 0; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 31 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 32 |  |  |     protected $files_length; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 33 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 34 |  |  |     protected $files; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 35 | 13 |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 36 |  |  |     protected $locales; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 37 | 13 |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 38 | 13 |  |     abstract protected function processor(): Processor; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 39 | 13 |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 40 | 13 |  |     public function handle() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 41 | 12 |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 42 | 12 |  |         $this->setLogger(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 43 |  |  |         $this->start(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 44 |  |  |         $this->clean(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 45 |  |  |         $this->ran(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 46 | 12 |  |         $this->end(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 47 |  |  |     } | 
            
                                                                                                            
                                                                
            
                                    
            
            
                | 48 | 12 |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 49 | 12 |  |     protected function ran(): void | 
            
                                                                        
                            
            
                                    
            
            
                | 50 |  |  |     { | 
            
                                                                        
                            
            
                                    
            
            
                | 51 | 12 |  |         foreach ($this->packages() as $package) { | 
            
                                                                        
                            
            
                                    
            
            
                | 52 |  |  |             $this->log('Packages handling: ' . $package); | 
            
                                                                        
                            
            
                                    
            
            
                | 53 | 11 |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 54 | 11 |  |             $this->validatePackage($package); | 
            
                                                                        
                            
            
                                    
            
            
                | 55 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 56 | 11 |  |             $this->ranLocales($package); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 57 |  |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 58 | 11 |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 59 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 60 |  |  |     protected function ranLocales(string $package): void | 
            
                                                                                                            
                            
            
                                    
            
            
                | 61 | 11 |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 62 |  |  |         foreach ($this->locales() as $locale) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 63 | 11 |  |             $this->log('Localization handling: ' . $locale); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 64 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 65 | 11 |  |             $this->validateLocale($locale); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 66 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 67 | 11 |  |             $this->ranFiles($package, $locale); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 68 | 11 |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 69 | 11 |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 70 | 11 |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 71 | 11 |  |     protected function ranFiles(string $package, string $locale): void | 
            
                                                                                                            
                            
            
                                    
            
            
                | 72 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 73 |  |  |         foreach ($this->files($package) as $filename) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 74 | 12 |  |             $this->log('Processing the localization file: ' . $filename); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 75 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 76 | 12 |  |             $status = $this->process($package, $locale, $filename); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 77 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 78 | 12 |  |             $this->processed($locale, $filename, $status, $package); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 79 | 11 |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 80 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 81 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 82 | 12 |  |     protected function process(string $package, string $locale, string $filename): string | 
            
                                                                                                            
                            
            
                                    
            
            
                | 83 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 84 |  |  |         $this->log('Launching the processor for localization: ' . $locale . ', ' . $filename); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 85 | 7 |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 86 |  |  |         return $this->processor() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 87 | 7 |  |             ->force($this->hasForce()) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 88 |  |  |             ->package($package) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 89 | 7 |  |             ->locale($locale) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 90 |  |  |             ->filename($filename, $this->hasInline()) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 91 |  |  |             ->run(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 92 | 12 |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 93 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 94 | 12 |  |     protected function locales(): array | 
            
                                                                                                            
                            
            
                                    
            
            
                | 95 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 96 | 12 |  |         $this->log('Getting a list of localizations...'); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 97 | 11 |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 98 |  |  |         if (! empty($this->locales)) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 99 |  |  |             return $this->locales; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 100 | 12 |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 101 | 12 |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 102 | 12 |  |         return $this->locales = LocalesSupport::make($this->input, $this->output, $this->action(), $this->targetLocales())->get(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 103 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 104 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 105 | 13 |  |     protected function targetLocales(): array | 
            
                                                                                                            
                            
            
                                    
            
            
                | 106 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 107 | 13 |  |         $this->log('Getting a list of installed localizations...'); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 108 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 109 | 13 |  |         return Locales::installed(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 110 | 13 |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 111 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 112 | 12 |  |     protected function packages(): array | 
            
                                                                                                            
                            
            
                                    
            
            
                | 113 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 114 | 12 |  |         return Packages::filtered(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 115 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 116 | 12 |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 117 | 12 |  |     protected function files(string $package): array | 
            
                                                                                                            
                            
            
                                    
            
            
                | 118 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 119 | 12 |  |         $this->log('Getting a list of files...'); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 120 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 121 | 12 |  |         if ($this->files[$package] ?? false) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 122 | 12 |  |             return $this->files[$package]; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 123 | 12 |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 124 | 12 |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 125 | 12 |  |         $path = $this->pathSource($package, LocalesList::ENGLISH); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 126 | 12 |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 127 |  |  |         return $this->files[$package] = File::names($path, static function ($filename) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 128 | 12 |  |             return ! Str::contains($filename, 'inline'); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 129 | 12 |  |         }); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 130 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 131 | 12 |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 132 |  |  |     protected function start(): void | 
            
                                                                                                            
                            
            
                                    
            
            
                | 133 | 12 |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 134 |  |  |         $action = $this->action()->present(true); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 135 | 12 |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 136 | 12 |  |         $this->info($action . ' localizations...'); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 137 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 138 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 139 | 12 |  |     protected function end(): void | 
            
                                                                                                            
                            
            
                                    
            
            
                | 140 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 141 | 12 |  |         $action = $this->action()->past(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 142 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 143 |  |  |         $this->info('Localizations have ben successfully ' . $action . '.'); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 144 | 12 |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 145 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 146 | 12 |  |     protected function processed(string $locale, string $filename, string $status, string $package = null): void | 
            
                                                                                                            
                            
            
                                    
            
            
                | 147 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 148 | 12 |  |         $message = Message::same() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 149 | 12 |  |             ->length($this->localesLength(), $this->filesLength($package)) | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 150 |  |  |             ->package($package) | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 151 |  |  |             ->locale($locale) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 152 | 12 |  |             ->filename($filename) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 153 |  |  |             ->status($status) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 154 | 12 |  |             ->get(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 155 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 156 |  |  |         $this->line($message); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 157 | 11 |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 158 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 159 | 11 |  |     protected function localesLength(): int | 
            
                                                                                                            
                            
            
                                    
            
            
                | 160 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 161 | 11 |  |         $this->log('Getting the maximum length of a localization string...'); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 162 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 163 |  |  |         if ($this->locales_length > 0) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 164 | 13 |  |             return $this->locales_length; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 165 |  |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 166 | 13 |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 167 |  |  |         $this->log('Calculating the maximum length of a localization string...'); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 168 | 13 |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 169 |  |  |         return $this->locales_length = Arr::longestStringLength($this->locales()); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 170 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 171 | 10 |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 172 |  |  |     protected function filesLength(string $package): int | 
            
                                                                                                            
                            
            
                                    
            
            
                | 173 | 10 |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 174 |  |  |         $this->log('Getting the maximum length of a filenames for ' . $package . '...'); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 175 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 176 | 2 |  |         if ($this->files_length[$package] ?? false) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 177 |  |  |             return $this->files_length[$package]; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 178 | 2 |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 179 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 180 |  |  |         $this->log('Calculating the maximum length of a filenames for ' . $package . '...'); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 181 | 10 |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 182 |  |  |         return $this->files_length[$package] = Arr::longestStringLength($this->files($package)); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 183 | 10 |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 184 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 185 |  |  |     protected function hasInline(): bool | 
            
                                                                                                            
                            
            
                                    
            
            
                | 186 | 13 |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 187 |  |  |         $this->log('Getting a use case for a validation file.'); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 188 | 13 |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 189 | 12 |  |         return Config::hasInline(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 190 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 191 | 4 |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 192 |  |  |     protected function action(): Actionable | 
            
                                                                                                            
                            
            
                                    
            
            
                | 193 | 4 |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 194 |  |  |         $this->log('Getting the action...'); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 195 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 196 | 13 |  |         return $this->container($this->action); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 197 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 198 | 13 |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 199 |  |  |     protected function hasForce(): bool | 
            
                                                                                                            
                            
            
                                    
            
            
                | 200 | 13 |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 201 | 13 |  |         return $this->boolOption('force'); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 202 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 203 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 204 |  |  |     protected function hasFull(): bool | 
            
                                                                                                            
                            
            
                                    
            
            
                | 205 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 206 |  |  |         return $this->boolOption('full'); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 207 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 208 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 209 |  |  |     protected function boolOption(string $key): bool | 
            
                                                                                                            
                            
            
                                    
            
            
                | 210 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 211 |  |  |         return $this->hasOption($key) && $this->option($key); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 212 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 213 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 214 |  |  |     protected function validateLocale(string $locale): void | 
            
                                                                                                            
                            
            
                                    
            
            
                | 215 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 216 |  |  |         Validator::locale($locale); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 217 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 218 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 219 |  |  |     protected function validatePackage(string $package): void | 
            
                                                                                                            
                            
            
                                    
            
            
                | 220 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 221 |  |  |         Validator::package($package); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 222 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 223 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 224 |  |  |     protected function doesntProtect(string $locale): bool | 
            
                                                                                                            
                            
            
                                    
            
            
                | 225 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 226 |  |  |         return ! Locales::isProtected($locale); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 227 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 228 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 229 |  |  |     protected function clean(): void | 
            
                                                                                                            
                            
            
                                    
            
            
                | 230 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 231 |  |  |         $this->log('Clear the variable from the saved localizations...'); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 232 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 233 |  |  |         $this->locales = null; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 234 |  |  |     } | 
            
                                                                                                            
                                                                
            
                                    
            
            
                | 235 |  |  | } | 
            
                                                        
            
                                    
            
            
                | 236 |  |  |  |