Total Complexity | 2 |
Total Lines | 29 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
12 | final class ArticleFactory extends AbstractComponentFactory |
||
13 | { |
||
14 | /** |
||
15 | * @inheritdoc |
||
16 | */ |
||
17 | 1 | public function create(?array $ops = null): Article |
|
18 | { |
||
19 | 1 | $component = new Article(); |
|
20 | 1 | $this->init($component, $ops); |
|
21 | 1 | $component->setTitle($this->ops['title']); |
|
22 | 1 | $component->setSubtitle($this->ops['subtitle']); |
|
23 | 1 | $component->setContent($this->ops['content']); |
|
24 | 1 | $component->setFilePath($this->ops['filePath']); |
|
25 | 1 | $this->validate($component); |
|
26 | 1 | return $component; |
|
27 | } |
||
28 | |||
29 | /** |
||
30 | * @inheritdoc |
||
31 | */ |
||
32 | 2 | protected static function defaultOps(): array |
|
41 | ] |
||
42 | ); |
||
45 |