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