| Conditions | 2 |
| Paths | 2 |
| Total Lines | 21 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 16 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 29 | 8 | public function addActionType(string $type, array $filter = [], ?string $agenda = null): self |
|
| 30 | { |
||
| 31 | 8 | if (!empty($this->data->actionType)) { |
|
| 32 | 1 | throw new PohodaException('Duplicate action type.'); |
|
| 33 | } |
||
| 34 | |||
| 35 | 8 | $actionTypeDto = new Type\Dtos\ActionTypeDto(); |
|
| 36 | 8 | $actionTypeDto->type = $type; |
|
| 37 | 8 | $actionTypeDto->filter = $filter; |
|
| 38 | 8 | $actionTypeDto->agenda = $agenda; |
|
| 39 | |||
| 40 | 8 | $actionType = new Type\ActionType( |
|
| 41 | 8 | $this->dependenciesFactory, |
|
| 42 | 8 | ); |
|
| 43 | 8 | $actionType |
|
| 44 | 8 | ->setDirectionalVariable($this->useOneDirectionalVariables) |
|
| 45 | 8 | ->setResolveOptions($this->resolveOptions) |
|
| 46 | 8 | ->setData($actionTypeDto); |
|
| 47 | 8 | $this->data->actionType = $actionType; |
|
| 48 | |||
| 49 | 8 | return $this; |
|
| 50 | } |
||
| 52 |