Conditions | 8 |
Paths | 8 |
Total Lines | 27 |
Code Lines | 19 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 72 |
Changes | 2 | ||
Bugs | 0 | Features | 2 |
1 | <?php |
||
12 | protected function setupClass(PhpNamespace $namespace): object |
||
13 | { |
||
14 | $interface = $namespace |
||
15 | ->addUse($this->model) |
||
16 | ->addUse($this->collection) |
||
17 | ->addInterface($this->class); |
||
18 | |||
19 | switch ($this->template) { |
||
20 | case 'post': |
||
21 | case 'post:h': |
||
22 | case 'attachment': |
||
23 | $base = SoftDeletingRepositoryInterface::class; |
||
24 | |||
25 | break; |
||
26 | |||
27 | case 'term': |
||
28 | case 'term:h': |
||
29 | case 'user': |
||
30 | case 'comment': |
||
31 | default: |
||
32 | $base = FungibleRepositoryInterface::class; |
||
33 | } |
||
34 | |||
35 | $namespace->addUse($base); |
||
36 | $interface->setExtends($base); |
||
37 | |||
38 | return $interface; |
||
39 | } |
||
41 |