| Conditions | 3 | 
| Paths | 6 | 
| Total Lines | 15 | 
| Lines | 0 | 
| Ratio | 0 % | 
| Changes | 0 | ||
| 1 | <?php  | 
            ||
| 58 | protected function waitForAjax($delay = .1)  | 
            ||
| 59 |     { | 
            ||
| 60 |         try { | 
            ||
| 61 | // delay slightly more than required  | 
            ||
| 62 | $delay and usleep($delay * 1100000);  | 
            ||
| 63 | |||
| 64 |             $this->waitFor(function () { | 
            ||
| 65 | return $this->session->execute(['script' => 'return !jQuery.active', 'args' => []]);  | 
            ||
| 66 | });  | 
            ||
| 67 |         } catch (\Throwable $exc) { | 
            ||
| 68 | $this->fail($exc->getMessage());  | 
            ||
| 69 | }  | 
            ||
| 70 | |||
| 71 | return $this;  | 
            ||
| 72 | }  | 
            ||
| 73 | }  | 
            ||
| 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
Idableprovides a methodequalsIdthat 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.