1 | <?php |
||
8 | class PalettesBuilder |
||
9 | { |
||
10 | protected $palettes = array(); |
||
11 | |||
12 | 3 | protected function __construct() |
|
15 | |||
16 | 3 | public static function create() |
|
20 | |||
21 | /** |
||
22 | * @param string $name |
||
23 | * @param array $colors |
||
24 | * @return PalettesBuilder |
||
25 | */ |
||
26 | public function addPalette($name, array $colors) |
||
34 | |||
35 | /** |
||
36 | * @param string $file |
||
37 | * @return PalettesBuilder |
||
38 | * @throws \InvalidArgumentException |
||
39 | */ |
||
40 | public function importPalettes($file) |
||
58 | |||
59 | /** |
||
60 | * @param string $name |
||
61 | * @return Palette |
||
62 | * @throws \InvalidArgumentException |
||
63 | */ |
||
64 | public function getNamedPalette($name) |
||
72 | |||
73 | /** |
||
74 | * @param int $count |
||
75 | * @return Palette |
||
76 | */ |
||
77 | 3 | public function getRandomPalette($count = 5) |
|
95 | |||
96 | /** |
||
97 | * @param array $colors |
||
98 | */ |
||
99 | public function getPalette(array $colors) |
||
104 | |||
105 | /** |
||
106 | * @return array |
||
107 | */ |
||
108 | public function getPalettes() |
||
112 | } |
||
113 |
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: