@@ 33-47 (lines=15) @@ | ||
30 | * |
|
31 | * @throws InvalidArgumentException |
|
32 | */ |
|
33 | public function addExecutor(ExecutorInterface $executor) |
|
34 | { |
|
35 | $action = $executor->getName(); |
|
36 | ||
37 | if ($this->hasExecutor($action)) { |
|
38 | throw new InvalidArgumentException( |
|
39 | sprintf( |
|
40 | 'There is already an executor registered for action "%s".', |
|
41 | $action |
|
42 | ) |
|
43 | ); |
|
44 | } |
|
45 | ||
46 | $this->executors[$action] = $executor; |
|
47 | } |
|
48 | ||
49 | /** |
|
50 | * Returns a registered executor for given action. |
@@ 126-138 (lines=13) @@ | ||
123 | * |
|
124 | * @throws \InvalidArgumentException |
|
125 | */ |
|
126 | public function addExecutor(ExecutorInterface $executor) |
|
127 | { |
|
128 | $action = $executor->getName(); |
|
129 | ||
130 | if ($this->hasExecutor($action)) { |
|
131 | throw new \InvalidArgumentException(sprintf( |
|
132 | 'There is already an executor registered for action "%s".', |
|
133 | $action |
|
134 | )); |
|
135 | } |
|
136 | ||
137 | $this->executors[$action] = $executor; |
|
138 | } |
|
139 | ||
140 | /** |
|
141 | * Returns a registered executor for given action. |