1 | <?php declare(strict_types = 1); |
||
13 | class GenericGenerator extends AbstractGenerator |
||
14 | { |
||
15 | /** @var ClassGenerator[] Collection of classes */ |
||
16 | protected $classes = []; |
||
17 | |||
18 | /** @var FunctionGenerator[] Collection of functions */ |
||
19 | protected $functions = []; |
||
20 | |||
21 | /** |
||
22 | * Set function. |
||
23 | * |
||
24 | * @param string $name Function |
||
25 | * @param bool $isStatic Flag that function is static |
||
26 | * |
||
27 | * @return FunctionGenerator New function generator instance |
||
28 | */ |
||
29 | public function defFunction(string $name, bool $isStatic = false) : FunctionGenerator |
||
33 | |||
34 | /** |
||
35 | * Set static function. |
||
36 | * |
||
37 | * @param string $name Function |
||
38 | * |
||
39 | * @return FunctionGenerator New function generator instance |
||
40 | */ |
||
41 | public function defStaticFunction(string $name) : FunctionGenerator |
||
45 | |||
46 | /** |
||
47 | * Set class. |
||
48 | * |
||
49 | * @param string $name Class name |
||
50 | * |
||
51 | * @return ClassGenerator |
||
52 | */ |
||
53 | public function defClass(string $name) : ClassGenerator |
||
57 | |||
58 | /** |
||
59 | * Generate code. |
||
60 | * |
||
61 | * @param int $indentation Code level |
||
62 | * |
||
63 | * @return string Generated code |
||
64 | */ |
||
65 | public function code($indentation = 0) |
||
77 | } |
||
78 |
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: