| Conditions | 2 |
| Paths | 2 |
| Total Lines | 9 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 23 | 5 | public function build($json) |
|
| 24 | { |
||
| 25 | 5 | $contract = \GuzzleHttp\json_decode($json, true); |
|
| 26 | 3 | if (!isset($contract['protocol'])) { |
|
| 27 | 1 | throw new \InvalidArgumentException('Invalid contract; Protocol is not specified'); |
|
| 28 | } |
||
| 29 | |||
| 30 | 2 | return $this->getBuilder($contract['protocol'])->build($contract); |
|
| 31 | } |
||
| 32 | |||
| 47 |