| Conditions | 5 |
| Paths | 3 |
| Total Lines | 13 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 5 |
| Changes | 0 | ||
| 1 | <?php |
||
| 28 | 34 | public function asset(string $type, ?string $locale = null): ?Asset |
|
| 29 | { |
||
| 30 | 34 | if ($this->assetRelation->first() === null || $this->assetRelation->first()->pivot === null) { |
|
| 31 | 3 | return null; |
|
| 32 | } |
||
| 33 | |||
| 34 | 32 | $assets = $this->assetRelation->where('pivot.type', $type); |
|
| 35 | |||
| 36 | 32 | if ($locale && $assets->count() > 1) { |
|
| 37 | 3 | $assets = $assets->where('pivot.locale', $locale); |
|
| 38 | } |
||
| 39 | |||
| 40 | 32 | return $assets->first(); |
|
| 41 | } |
||
| 58 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.