Total Complexity | 4 |
Total Lines | 39 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
10 | final class ArticleCommentFactory implements ArticleCommentFactoryInterface |
||
11 | { |
||
12 | /** @var string */ |
||
13 | private $className; |
||
14 | |||
15 | /** @var ArticleRepositoryInterface */ |
||
16 | private $articleRepository; |
||
17 | |||
18 | public function __construct(string $className, ArticleRepositoryInterface $articleRepository) |
||
19 | { |
||
20 | $this->className = $className; |
||
21 | $this->articleRepository = $articleRepository; |
||
22 | } |
||
23 | |||
24 | /** |
||
25 | * {@inheritdoc} |
||
26 | */ |
||
27 | public function createNew() |
||
28 | { |
||
29 | return new $this->className(); |
||
30 | } |
||
31 | |||
32 | /** |
||
33 | * {@inheritdoc} |
||
34 | */ |
||
35 | public function createNewWithArticle(string $id): ArticleCommentInterface |
||
49 | } |
||
50 | } |
||
51 |