@@ 14-19 (lines=6) @@ | ||
11 | public static function isSameTypehints(array $paramsA, array $paramsB) |
|
12 | { |
|
13 | $iterations = min(count($paramsA), count($paramsB)); |
|
14 | for ($i = 0; $i < $iterations; ++$i) { |
|
15 | // TODO: Allow for contravariance <[email protected]> |
|
16 | if ( ! Type::isSame($paramsA[$i]->type, $paramsB[$i]->type)) { |
|
17 | return false; |
|
18 | } |
|
19 | } |
|
20 | // Only one of these will return its remaining values, the other returning an empty array |
|
21 | $toCheck = array_slice($paramsA, $iterations) + array_slice($paramsB, $iterations); |
|
22 | // If any additional argument does not have a default value, the signature has changed |
|
@@ 43-47 (lines=5) @@ | ||
40 | } |
|
41 | ||
42 | $iterations = min(count($paramsA), count($paramsB)); |
|
43 | for ($i = 0; $i < $iterations; ++$i) { |
|
44 | if ($paramsA[$i]->name != $paramsB[$i]->name) { |
|
45 | return false; |
|
46 | } |
|
47 | } |
|
48 | return true; |
|
49 | } |
|
50 | } |