| Conditions | 3 |
| Paths | 3 |
| Total Lines | 13 |
| Code Lines | 8 |
| Lines | 13 |
| Ratio | 100 % |
| Tests | 10 |
| CRAP Score | 3 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 50 | 17 | public function concat($iterable) |
|
| 51 | { |
||
| 52 | 17 | if ($iterable instanceof Iterable) { |
|
| 53 | 17 | $iterable = $iterable->toArray(); |
|
| 54 | 16 | } |
|
| 55 | 6 | ||
| 56 | 6 | return new static(array_merge_recursive($this->toArray(), $iterable)); |
|
| 57 | 16 | } |
|
| 58 | 1 | ||
| 59 | 17 | /** |
|
| 60 | * {@inheritdoc} |
||
| 61 | 17 | */ |
|
| 62 | public function clear() |
||
| 63 | { |
||
| 73 |
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.