Total Complexity | 2 |
Total Lines | 27 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 0 |
1 | <?php |
||
8 | class PageFactory extends AbstractFactory |
||
9 | { |
||
10 | public const PAGE_OPS = [ |
||
11 | 'title' => 'New Page', |
||
12 | 'metaDescription' => null, |
||
13 | 'parent' => null, |
||
14 | 'layout' => null, |
||
15 | 'route' => null |
||
16 | ]; |
||
17 | |||
18 | /** |
||
19 | * @inheritdoc |
||
20 | */ |
||
21 | public function create(?array $ops = null): Page |
||
22 | { |
||
23 | $component = new Page(); |
||
24 | $this->init($component, $ops); |
||
25 | $this->validate($component); |
||
26 | return $component; |
||
27 | } |
||
28 | |||
29 | /** |
||
30 | * @inheritdoc |
||
31 | */ |
||
32 | protected static function defaultOps(): array |
||
35 | } |
||
36 | } |
||
37 |