| 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 |
Since your code implements the magic getter
_get, this function will be called for any read access on an undefined variable. You can add the@propertyannotation to your class or interface to document the existence of this variable.If the property has read access only, you can use the @property-read annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
See also the PhpDoc documentation for @property.