| Conditions | 2 |
| Paths | 1 |
| Total Lines | 14 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 21 | protected static function boot() |
||
| 22 | { |
||
| 23 | parent::boot(); |
||
| 24 | static::creating(function (Url $url) { |
||
| 25 | $url->created_at = Carbon::now(); |
||
|
|
|||
| 26 | }); |
||
| 27 | static::deleting(function (Url $url) { |
||
| 28 | if ($url->redirectedToBy) { |
||
| 29 | $url->redirectedToBy->each(function (Url $url) { |
||
| 30 | $url->delete(); |
||
| 31 | }); |
||
| 32 | } |
||
| 33 | }); |
||
| 34 | } |
||
| 35 | |||
| 72 |
Since your code implements the magic setter
_set, this function will be called for any write access on an undefined variable. You can add the@propertyannotation to your class or interface to document the existence of this variable.Since the property has write access only, you can use the @property-write 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.