| Conditions | 3 |
| Paths | 3 |
| Total Lines | 11 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 3.0261 |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 36 | 27 | public function __construct(Parser $parser, string $name, $type = null) |
|
| 37 | { |
||
| 38 | 27 | $this->parser = $parser; |
|
| 39 | 10 | $this->setBaseName($name); |
|
| 40 | 17 | ||
| 41 | 17 | if ($type instanceof Type) { |
|
| 42 | $this->type = $type; |
||
| 43 | } elseif (!$type) { |
||
| 44 | $this->type = $parser->getSchema()->getType($name); |
||
| 45 | 27 | } else { |
|
| 46 | throw new Exception('Invalid model'); |
||
| 47 | 10 | } |
|
| 84 |