Conditions | 2 |
Paths | 2 |
Total Lines | 14 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
35 | public function createNewWithArticle(string $id): ArticleCommentInterface |
||
36 | { |
||
37 | /** @var ArticleInterface $article */ |
||
38 | $article = $this->articleRepository->find($id); |
||
39 | |||
40 | if (!$article instanceof ArticleInterface) { |
||
|
|||
41 | throw new Exception(); |
||
42 | } |
||
43 | |||
44 | /** @var ArticleCommentInterface $articleComment */ |
||
45 | $articleComment = $this->createNew(); |
||
46 | $articleComment->setArticle($article); |
||
47 | |||
48 | return $articleComment; |
||
49 | } |
||
51 |