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