Conditions | 2 |
Paths | 2 |
Total Lines | 14 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
23 | public static function findOrCreate($name, string $type = null, string $locale = null): Tag |
||
24 | { |
||
25 | if ($existingTag = parent::findFromString($name, $type)) { |
||
|
|||
26 | return $existingTag; |
||
27 | } |
||
28 | |||
29 | $tag = parent::findOrCreate($name, $type); |
||
30 | |||
31 | $tag->setTranslations('name', array_fill_keys(config('app.locales'), $name)); |
||
32 | |||
33 | $tag->save(); |
||
34 | |||
35 | return $tag; |
||
36 | } |
||
37 | } |
||
38 |
This check looks for a call to a parent method whose name is different than the method from which it is called.
Consider the following code:
The
getFirstName()
method in theSon
calls the wrong method in the parent class.