@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | public function railway() : Railway |
11 | 11 | { |
12 | 12 | return (new Railway) |
13 | - ->step(function ($params) { |
|
13 | + ->step(function($params) { |
|
14 | 14 | echo "Hey {$params['name']}. Say hello to anonymous function!"; |
15 | 15 | //return error($params, 'Early fail'); |
16 | 16 | return ok($params, ['newParam' => 'newValue']); |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | ->tryCatch([$this, 'sendNotification']) |
25 | 25 | ->always([$this, 'writeLog']) |
26 | 26 | ->failure([$this, 'notifyAdmin'], ['name' => 'Last']) |
27 | - ->step(function ($params) { |
|
27 | + ->step(function($params) { |
|
28 | 28 | return ok($params, ['a' => 'b']); |
29 | 29 | }, ['after' => 'First', 'name' => 'FinalCheck']); |
30 | 30 | } |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | public function nestedRailway($params) |
43 | 43 | { |
44 | 44 | return (new Railway) |
45 | - ->step(function ($params) { |
|
45 | + ->step(function($params) { |
|
46 | 46 | //return error($params, 'Nested Railway failed!'); |
47 | 47 | return ok($params, ['nestedRwParam' => 'nestedRwValue']); |
48 | 48 | }) |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | protected function findTargetStepIndex($stepName) |
37 | 37 | { |
38 | 38 | $steps = array_column($this->stepsQueue, 'step'); |
39 | - $names = array_map(function ($step) { |
|
39 | + $names = array_map(function($step) { |
|
40 | 40 | return $step->name(); |
41 | 41 | }, $steps); |
42 | 42 | |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | return $this->rawStep(new TryCatch($callable, $name), $opt); |
132 | 132 | } |
133 | 133 | |
134 | - public function removeStep(string $stepName){ |
|
134 | + public function removeStep(string $stepName) { |
|
135 | 135 | $targetIndex = $this->findTargetStepIndex($stepName); |
136 | 136 | unset($this->stepsQueue[$targetIndex]); |
137 | 137 | return $this; |