| Conditions | 1 |
| Paths | 1 |
| Total Lines | 12 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 1 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 20 | public function createComment(CommentStoreRequest $data, object $entity): Comment |
||
| 21 | 1 | { |
|
| 22 | $comment = new Comment(); |
||
| 23 | 1 | $comment->body = $data['body']; |
|
| 24 | 1 | $comment->name = $data['name']; |
|
| 25 | 1 | $comment->email = $data['email']; |
|
| 26 | 1 | ||
| 27 | $entity->comments()->save($comment); |
||
| 28 | 1 | ||
| 29 | //then publish comment |
||
| 30 | 1 | ||
| 31 | return $comment; |
||
| 32 | } |
||
| 33 | } |