1 | <?php |
||
8 | class Vector3 extends Vector2 |
||
9 | { |
||
10 | /** |
||
11 | * Initializes a new instance of this class. |
||
12 | * |
||
13 | * @param float $x The X-component to set. |
||
14 | * @param float $y The Y-component to set. |
||
15 | * @param float $z The Z-component to set. |
||
16 | */ |
||
17 | 5 | public function __construct($x, $y, $z) |
|
23 | |||
24 | /** |
||
25 | * Calculates the cross product between this vector and the given vector. |
||
26 | * |
||
27 | * @param Vector3 $vector The vector to calculate with. |
||
28 | * @return Vector3 |
||
29 | */ |
||
30 | 1 | public function crossProduct(Vector3 $vector) |
|
43 | |||
44 | /** |
||
45 | * Gets the X-component from this vector. |
||
46 | * |
||
47 | * @return float |
||
48 | */ |
||
49 | 3 | public function getZ() |
|
53 | |||
54 | /** |
||
55 | * Sets the Z-component in this vector. |
||
56 | * |
||
57 | * @param float $z The Z-component to set |
||
58 | */ |
||
59 | 5 | public function setZ($z) |
|
63 | |||
64 | /** |
||
65 | * Validates the index. |
||
66 | * |
||
67 | * @param int $index The index to validate. |
||
68 | * @param bool $indexShouldExists Whether or not the index should exists. |
||
69 | * @throws InvalidArgumentException Thrown when the index is invalid. |
||
70 | */ |
||
71 | 5 | protected function validateIndex($index, $indexShouldExists) |
|
77 | } |
||
78 |
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: