Conditions | 2 |
Paths | 1 |
Total Lines | 11 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 4 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
26 | public function each(callable $______callback, $______allArgs = false) |
||
27 | { |
||
28 | return $this->chainWith( |
||
|
|||
29 | new \CallbackFilterIterator($this->getIterator(), |
||
30 | function () use ($______callback, $______allArgs |
||
31 | ) { |
||
32 | call_user_func_array($______callback, $______allArgs ? func_get_args() : [func_get_arg(0)]); |
||
33 | |||
34 | return true; |
||
35 | })); |
||
36 | } |
||
37 | } |
||
38 |
This check looks for methods that are used by a trait but not required by it.
To illustrate, let’s look at the following code example
The trait
Idable
provides a methodequalsId
that in turn relies on the methodgetId()
. If this method does not exist on a class mixing in this trait, the method will fail.Adding the
getId()
as an abstract method to the trait will make sure it is available.