| Conditions | 4 |
| Paths | 4 |
| Total Lines | 18 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 24 | 12 | public function __construct($statement) |
|
| 25 | { |
||
| 26 | 12 | if (!isset($statement['Action'])) { |
|
| 27 | 2 | throw new \InvalidArgumentException('Missing required field Action.'); |
|
| 28 | } |
||
| 29 | |||
| 30 | 10 | if (!isset($statement['Resource'])) { |
|
| 31 | 1 | throw new \InvalidArgumentException('Missing required field Resource.'); |
|
| 32 | } |
||
| 33 | |||
| 34 | 9 | if (!isset($statement['Effect'])) { |
|
| 35 | 1 | throw new \InvalidArgumentException('Missing required field Effect.'); |
|
| 36 | } |
||
| 37 | |||
| 38 | 8 | $this->action = new Action($statement['Action']); |
|
| 39 | 8 | $this->resource = new Resource($statement['Resource']); |
|
| 40 | 8 | $this->effect = new Effect($statement['Effect']); |
|
| 41 | 8 | } |
|
| 42 | |||
| 85 |