These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | /* |
||
4 | * PHP-CS-Fixer plugin for HiDev |
||
5 | * |
||
6 | * @link https://github.com/hiqdev/hidev-php-cs-fixer |
||
7 | * @package hidev-php-cs-fixer |
||
8 | * @license BSD-3-Clause |
||
9 | * @copyright Copyright (c) 2015-2016, HiQDev (http://hiqdev.com/) |
||
10 | */ |
||
11 | |||
12 | namespace hidev\phpcsfixer\controllers; |
||
13 | |||
14 | /** |
||
15 | * Goal for php-cs-fixer. |
||
16 | */ |
||
17 | class PhpCsFixerController extends \hidev\controllers\FileController |
||
18 | { |
||
19 | protected $_before = ['.php_cs']; |
||
20 | |||
21 | public function actionMake() |
||
22 | { |
||
23 | return $this->runAction('fix'); |
||
24 | } |
||
25 | |||
26 | public function actionFix() |
||
27 | { |
||
28 | $this->runAction('stop-fix'); |
||
29 | } |
||
30 | |||
31 | public function actionStopFix() |
||
32 | { |
||
33 | return $this->passthru('php-cs-fixer', ['fix', '.']); |
||
0 ignored issues
–
show
|
|||
34 | } |
||
35 | |||
36 | public function actionCheck() |
||
37 | { |
||
38 | return $this->passthru('php-cs-fixer', ['fix', '.', '--dry-run']); |
||
0 ignored issues
–
show
array('fix', '.', '--dry-run') is of type array<integer,string,{"0..."string","2":"string"}> , but the function expects a string .
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: function acceptsInteger($int) { }
$x = '123'; // string "123"
// Instead of
acceptsInteger($x);
// we recommend to use
acceptsInteger((integer) $x);
Loading history...
|
|||
39 | } |
||
40 | } |
||
41 |
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: