| Conditions | 2 |
| Paths | 2 |
| Total Lines | 10 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 43 | public function handle() |
||
| 44 | { |
||
| 45 | $this->employee->avatar = Gravatar::exists($this->employee->work_email) ? Gravatar::src($this->employee->work_email, 400) : '/images/profile/default/0.png'; |
||
| 46 | |||
| 47 | $this->employee->save(); |
||
| 48 | |||
| 49 | $message = 'Successfully updated avatar of employee_id '.$this->employee->id; |
||
| 50 | |||
| 51 | Log::info($message); |
||
| 52 | } |
||
| 53 | } |
||
| 54 |
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.