Conditions | 2 |
Paths | 2 |
Total Lines | 16 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
36 | 3 | public function create(Specification $spec): string |
|
37 | { |
||
38 | 3 | if (!$spec instanceof Not) { |
|
39 | 1 | throw new \InvalidArgumentException(); |
|
40 | } |
||
41 | |||
42 | 2 | $wrappedSpec = $spec->getWrappedSpecification(); |
|
43 | 2 | $this->validate($wrappedSpec); |
|
44 | |||
45 | 1 | $firstPartFactory = $this->registry->getFactory($wrappedSpec); |
|
46 | |||
47 | 1 | return sprintf( |
|
48 | 1 | 'NOT %s', |
|
49 | 1 | $firstPartFactory->create($wrappedSpec) |
|
50 | ); |
||
51 | } |
||
52 | |||
66 |