Conditions | 2 |
Paths | 2 |
Total Lines | 19 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php |
||
18 | public static function create() : KernelInterface |
||
19 | { |
||
20 | $env = 'debug'; |
||
21 | $debug = true; |
||
22 | |||
23 | // We are relying on our calling script to chdir as appropriate with any |
||
24 | // --project-directory that was specified. |
||
25 | $projectDir = getcwd(); |
||
26 | |||
27 | if (file_exists($customKernel = $projectDir.'/app/SculpinKernel.php')) { |
||
28 | require $customKernel; |
||
29 | |||
30 | return new \SculpinKernel($env, $debug, $projectDir); |
||
31 | } |
||
32 | |||
33 | // Fallback to using the default kernel in case |
||
34 | // user does not define their own kernel somehow. |
||
35 | return new DefaultKernel($env, $debug, $projectDir); |
||
|
|||
36 | } |
||
37 | } |
||
38 |
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: