Conditions | 2 |
Paths | 2 |
Total Lines | 10 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 2.0932 |
Changes | 0 |
1 | <?php |
||
34 | 1 | public function write(SourceOutput $output) |
|
35 | { |
||
36 | 1 | $outputPath = $this->outputDir.'/'.$output->permalink()->relativeFilePath(); |
|
37 | 1 | if ($output->hasFileReference()) { |
|
38 | 1 | $this->filesystem->copy($output->file(), $outputPath, true); |
|
|
|||
39 | } else { |
||
40 | $this->filesystem->mkdir(dirname($outputPath)); |
||
41 | file_put_contents($outputPath, $output->formattedContent()); |
||
42 | } |
||
43 | 1 | } |
|
44 | } |
||
45 |
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: