| @@ 244-249 (lines=6) @@ | ||
| 241 | private function setSteps(array $steps): void |
|
| 242 | { |
|
| 243 | foreach ($steps as $step) { |
|
| 244 | if (!$step instanceof StepInterface) { |
|
| 245 | throw new \InvalidArgumentException(\sprintf( |
|
| 246 | 'Expected %s instance, "%s" given.', |
|
| 247 | StepActionInterface::class, |
|
| 248 | \is_object($step) ? \get_class($step) : \gettype($step) |
|
| 249 | )); |
|
| 250 | } |
|
| 251 | } |
|
| 252 | ||
| @@ 60-65 (lines=6) @@ | ||
| 57 | if ($action instanceof \Closure) { |
|
| 58 | // Lazy loading |
|
| 59 | $action = $this->actions[$manager][$stepName](); |
|
| 60 | if (!$action instanceof StepActionInterface) { |
|
| 61 | throw new \RuntimeException(\sprintf( |
|
| 62 | "Lazy-loaded action \"%s\" for character manager \"%s\" must be resolved to an instance of \"%s\".\n\"%s\" given.", |
|
| 63 | $stepName, |
|
| 64 | $manager, |
|
| 65 | StepActionInterface::class, |
|
| 66 | \is_object($action) ? \get_class($action) : \gettype($action) |
|
| 67 | )); |
|
| 68 | } |
|