|
@@ -58,17 +58,17 @@ |
|
|
block discarded – undo |
|
58
|
58
|
|
|
59
|
59
|
protected function addHandlers($machine) { |
|
60
|
60
|
$class = get_class($machine->getObject()); |
|
61
|
|
- if (empty($this->config()->handlers[$class])) return; |
|
|
61
|
+ if(empty($this->config()->handlers[$class])) return; |
|
62
|
62
|
|
|
63
|
63
|
$transitions = $this->config()->handlers[$class]; |
|
64
|
|
- foreach ($transitions as $transName => $handlers) { |
|
65
|
|
- if (!is_array($handlers)) { |
|
|
64
|
+ foreach($transitions as $transName => $handlers) { |
|
|
65
|
+ if(!is_array($handlers)) { |
|
66
|
66
|
throw new Exception(sprintf('Transition %s must be configured as an assoc array.', $transName)); |
|
67
|
67
|
} |
|
68
|
68
|
|
|
69
|
|
- foreach ($handlers as $handlerClass => $handlerMethod) { |
|
|
69
|
+ foreach($handlers as $handlerClass => $handlerMethod) { |
|
70
|
70
|
$handlerObj = Injector::inst()->get($handlerClass); |
|
71
|
|
- if (!is_callable([$handlerObj, $handlerMethod])) { |
|
|
71
|
+ if(!is_callable([$handlerObj, $handlerMethod])) { |
|
72
|
72
|
throw new Exception(sprintf('Handler %s is not callable on %s.', $handlerMethod, $handlerClass)); |
|
73
|
73
|
} |
|
74
|
74
|
$machine->getDispatcher()->addListener( |
Please login to merge, or discard this patch.