Total Complexity | 7 |
Total Lines | 67 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | class ArticleBuilder implements ArticleInterface |
||
10 | { |
||
11 | private $author; |
||
12 | |||
13 | private array $titles; |
||
14 | |||
15 | private array $texts; |
||
16 | |||
17 | private EntityManagerInterface $em; |
||
18 | |||
19 | /** |
||
20 | * @param EntityManagerInterface $em |
||
21 | */ |
||
22 | public function __construct(EntityManagerInterface $em) |
||
23 | { |
||
24 | $this->em = $em; |
||
25 | } |
||
26 | |||
27 | /** |
||
28 | * @param $author |
||
29 | * @return ArticleBuilder |
||
30 | */ |
||
31 | public function setAuthor($author): ArticleBuilder |
||
32 | { |
||
33 | $this->author = $author; |
||
34 | return $this; |
||
35 | } |
||
36 | |||
37 | /** |
||
38 | * @param string $title |
||
39 | * @param string $lang |
||
40 | * @return $this |
||
41 | */ |
||
42 | public function setTitle(string $title, string $lang): ArticleBuilder |
||
43 | { |
||
44 | $this->titles[$lang] = $title; |
||
45 | return $this; |
||
46 | } |
||
47 | |||
48 | /** |
||
49 | * @param string $text |
||
50 | * @param string $lang |
||
51 | * @return $this |
||
52 | */ |
||
53 | public function setText(string $text, string $lang): ArticleBuilder |
||
57 | } |
||
58 | |||
59 | public function send() |
||
76 | } |
||
77 | } |
||
78 |