Conditions | 3 |
Paths | 5 |
Total Lines | 11 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
38 | protected function waitFor(callable $action, callable $callback = null) |
||
39 | { |
||
40 | try { |
||
41 | $elm = (new Wait($this->session))->until($action); |
||
42 | $callback and call_user_func($callback, $elm); |
||
43 | } catch (\Throwable $exc) { |
||
44 | $this->fail($exc->getMessage()); |
||
|
|||
45 | } |
||
46 | |||
47 | return $this; |
||
48 | } |
||
49 | |||
74 |
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.