| Conditions | 2 |
| Paths | 2 |
| Total Lines | 22 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 15 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 11 | 5 | public function find(string $key) |
|
| 12 | { |
||
| 13 | 5 | $translation = $this->query() |
|
| 14 | 5 | ->where(DB::raw("CONCAT(`group`, '.', `key`)"), $key) |
|
| 15 | 5 | ->first(); |
|
| 16 | |||
| 17 | 5 | if (null === $translation) { |
|
| 18 | 3 | return app('mage.translations')::fromArray([ |
|
|
|
|||
| 19 | 3 | 'key' => $key, |
|
| 20 | ]); |
||
| 21 | } |
||
| 22 | |||
| 23 | 2 | $translation = app('mage.translations')::fromArray([ |
|
| 24 | 2 | 'id' => $translation->id, |
|
| 25 | 2 | 'key' => $translation->group.'.'.$translation->key, |
|
| 26 | 2 | 'translations' => $translation->text, |
|
| 27 | 2 | 'sync_at' => $translation->sync_at, |
|
| 28 | 2 | 'created_at' => $translation->created_at, |
|
| 29 | 2 | 'updated_at' => $translation->updated_at, |
|
| 30 | ]); |
||
| 31 | |||
| 32 | 2 | return $translation; |
|
| 33 | } |
||
| 35 |
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.