| Conditions | 1 |
| Paths | 1 |
| Total Lines | 11 |
| Code Lines | 8 |
| Lines | 11 |
| Ratio | 100 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 44 | View Code Duplication | protected function trigger(Comment &$comment, $action) |
|
| 45 | { |
||
| 46 | $data = [ |
||
| 47 | 'target_type' => 'Comment', |
||
| 48 | 'target_id' => $comment->id, |
||
| 49 | 'action' => $action, |
||
| 50 | 'author_id' => $comment->author_id, |
||
| 51 | 'project_id' => $comment->project->id, |
||
| 52 | ]; |
||
| 53 | $moment = Moment::create($data); |
||
| 54 | } |
||
| 55 | } |
||
| 56 |
If you access a property on an interface, you most likely code against a concrete implementation of the interface.
Available Fixes
Adding an additional type check:
Changing the type hint: