1 | <?php |
||
11 | trait MapCodeGeneratorTrait |
||
12 | { |
||
13 | /** |
||
14 | * @var LoggerInterface |
||
15 | */ |
||
16 | private $logger; |
||
17 | /** |
||
18 | * @var FileSystemInterface |
||
19 | */ |
||
20 | private $fileSystem; |
||
21 | |||
22 | 6 | public function __construct( |
|
30 | |||
31 | 6 | public function generate( |
|
32 | string $templateClassName, |
||
33 | \Iterator $files, |
||
34 | string $outputFilePath, |
||
35 | string $outputShortClassName |
||
36 | ) |
||
37 | { |
||
38 | 6 | $this->getGenerator() |
|
39 | 6 | ->discoverAndPutContents( |
|
40 | 6 | $this->discover($files), |
|
|
|||
41 | 5 | $templateClassName, |
|
42 | 5 | $outputFilePath, |
|
43 | 5 | $outputShortClassName |
|
44 | ); |
||
45 | |||
46 | 5 | $this->log($outputFilePath, $files); |
|
47 | 5 | } |
|
48 | |||
49 | abstract protected function log($outputFilePath); |
||
50 | |||
51 | abstract protected function discover(string $searchDirectory): array; |
||
52 | |||
53 | abstract protected function getGenerator(): CodeGenerator; |
||
54 | } |
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: