| Conditions | 1 |
| Paths | 1 |
| Total Lines | 25 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 1 |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | public function handle(SheetPusher $pusher, Spreadsheet $spreadsheet, Writer $writer) |
||
| 19 | 1 | { |
|
| 20 | 1 | $spreadsheet->sheets()->each(function (TranslationsSheet $translationsSheet) use ($pusher, $spreadsheet, $writer) { |
|
| 21 | 1 | ||
| 22 | 1 | $this->output->writeln("<comment>Scanning local languages files for sheet [{$translationsSheet->getTitle()}]</comment>"); |
|
| 23 | |||
| 24 | $pusher = $pusher->setTranslationsSheet($translationsSheet); |
||
|
|
|||
| 25 | 1 | ||
| 26 | 1 | $translations = Util::keyValues( |
|
| 27 | $pusher->getScannedAndTransformedTranslations(), |
||
| 28 | 1 | $spreadsheet->getCamelizedHeader() |
|
| 29 | 1 | ); |
|
| 30 | |||
| 31 | $this->output->writeln('<comment>.... Rewriting</comment>'); |
||
| 32 | $writer |
||
| 33 | ->setTranslationsSheet($translationsSheet) |
||
| 34 | ->setTranslations($translations) |
||
| 35 | ->withOutput($this->output) |
||
| 36 | ->write(); |
||
| 37 | |||
| 38 | $translationsSheet->api()->reset(); |
||
| 39 | }); |
||
| 40 | |||
| 41 | $this->output->writeln('<info>Done.</info>'); |
||
| 42 | } |
||
| 43 | } |
||
| 44 |
It seems like you are assigning to a variable which was imported through a
usestatement which was not imported by reference.For clarity, we suggest to use a different name or import by reference depending on whether you would like to have the change visibile in outer-scope.
Change not visible in outer-scope
Change visible in outer-scope