| Conditions | 1 |
| Paths | 1 |
| Total Lines | 34 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 30 | public function init() |
||
| 31 | { |
||
| 32 | $magentoHint = <<<MAGENTOHINT |
||
| 33 | You are running a Magento 1.x instance. This version of n98-magerun is not compatible |
||
| 34 | with Magento 1.x. Please use n98-magerun (version 1) for this shop. |
||
| 35 | |||
| 36 | A current version of the software can be downloaded from the website: |
||
| 37 | |||
| 38 | <info>Download with curl |
||
| 39 | ------------------</info> |
||
| 40 | |||
| 41 | <comment>curl -O https://files.magerun.net/n98-magerun.phar</comment> |
||
| 42 | |||
| 43 | <info>Download with wget |
||
| 44 | ------------------</info> |
||
| 45 | |||
| 46 | <comment>wget https://files.magerun.net/n98-magerun.phar</comment> |
||
| 47 | |||
| 48 | MAGENTOHINT; |
||
| 49 | |||
| 50 | $output = new ConsoleOutput(); |
||
| 51 | |||
| 52 | /** @var $formatter FormatterHelper */ |
||
| 53 | $formatter = $this->helperSet->get('formatter'); |
||
| 54 | |||
| 55 | $output->writeln([ |
||
|
|
|||
| 56 | '', |
||
| 57 | $formatter->formatBlock('Compatibility Notice', 'bg=blue;fg=white', true), |
||
| 58 | '', |
||
| 59 | $magentoHint, |
||
| 60 | ]); |
||
| 61 | |||
| 62 | throw new RuntimeException('This version of n98-magerun is not compatible with Magento 1'); |
||
| 63 | } |
||
| 64 | } |
||
| 65 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: