1 | <?php |
||
9 | class PalettesBuilder |
||
10 | { |
||
11 | protected $palettes = array(); |
||
12 | |||
13 | 3 | protected function __construct() |
|
16 | |||
17 | 3 | public static function create() |
|
21 | |||
22 | /** |
||
23 | * @param string $name |
||
24 | * @param array $colors |
||
25 | * @return PalettesBuilder |
||
26 | */ |
||
27 | public function addPalette($name, array $colors) |
||
35 | |||
36 | /** |
||
37 | * @param string $file |
||
38 | * @return PalettesBuilder |
||
39 | * @throws \InvalidArgumentException |
||
40 | */ |
||
41 | public function importPalettes($file) |
||
55 | |||
56 | /** |
||
57 | * @param string $name |
||
58 | * @return Palette |
||
59 | * @throws \InvalidArgumentException |
||
60 | */ |
||
61 | public function getNamedPalette($name) |
||
66 | |||
67 | /** |
||
68 | * @param int $count |
||
69 | * @return Palette |
||
70 | */ |
||
71 | 3 | public function getRandomPalette($count = 5) |
|
89 | |||
90 | /** |
||
91 | * @param array $colors |
||
92 | */ |
||
93 | public function getPalette(array $colors) |
||
99 | |||
100 | /** |
||
101 | * @return array |
||
102 | */ |
||
103 | public function getPalettes() |
||
107 | } |
||
108 |
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: