1 | <?php |
||
7 | class VisualDiff |
||
8 | { |
||
9 | protected $nodeBinary = null; |
||
10 | |||
11 | protected $npmBinary = null; |
||
12 | |||
13 | protected $includePath = '$PATH:/usr/local/bin'; |
||
14 | |||
15 | protected $binPath = null; |
||
16 | |||
17 | protected $nodeModulePath = null; |
||
18 | |||
19 | protected $newImage; |
||
20 | |||
21 | protected $comparisonImage; |
||
22 | |||
23 | protected $threshold = 0.1; |
||
24 | |||
25 | protected $antialias = false; |
||
26 | |||
27 | |||
28 | public function setNodeBinary(string $nodeBinary) |
||
34 | |||
35 | public function setNpmBinary(string $npmBinary) |
||
41 | |||
42 | public function setIncludePath(string $includePath) |
||
48 | |||
49 | public function setBinPath(string $binPath) |
||
55 | |||
56 | public function setNodeModulePath(string $nodeModulePath) |
||
62 | |||
63 | public function setAntialias(bool $antialias) |
||
69 | |||
70 | public function setThreshold(float $threshold) |
||
76 | |||
77 | protected function getNodePathCommand(string $nodeBinary): string |
||
87 | |||
88 | public function __construct(string $newImage, string $comparisonImage) |
||
93 | |||
94 | public static function diff(string $newImage, string $comparisonImage) |
||
98 | |||
99 | public function buildSaveCommand($filename): array |
||
109 | |||
110 | public function save($filename) |
||
116 | |||
117 | protected function callDiff(array $command) |
||
141 | } |
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: