Completed
Pull Request — master (#582)
by Mateusz
03:31 queued 31s
created
code/model/StateMachineFactory.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -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.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -58,7 +58,9 @@
 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])) {
62
+			return;
63
+		}
62 64
 
63 65
 		$transitions = $this->config()->handlers[$class];
64 66
 		foreach ($transitions as $transName => $handlers) {
Please login to merge, or discard this patch.