Completed
Push — master ( 5d51b9...626678 )
by Ievgen
03:50
created
src/Railway.php 2 patches
Doc Comments   +5 added lines, -1 removed lines patch added patch discarded remove patch
@@ -74,6 +74,9 @@  discard block
 block discarded – undo
74 74
         return $this->rawStep(new Wrap($callable, $signature), $opt);
75 75
     }
76 76
 
77
+    /**
78
+     * @param string $stepName
79
+     */
77 80
     protected function nextStepSignature(callable $callable, $stepName, $opt)
78 81
     {
79 82
         is_callable($callable, false, $functionName);
@@ -104,7 +107,8 @@  discard block
 block discarded – undo
104 107
 
105 108
     /**
106 109
      * @param $params
107
-     * @param $step
110
+     * @param AbstractStep $step
111
+     * @param string $track
108 112
      * @return string
109 113
      * @throws \Exception
110 114
      */
Please login to merge, or discard this patch.
Unused Use Statements   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,10 +8,10 @@
 block discarded – undo
8 8
 use function einfach\operation\response\isValidResponse;
9 9
 use const einfach\operation\response\RESPONSE_TYPE_ERROR;
10 10
 use const einfach\operation\response\RESPONSE_TYPE_OK;
11
-use einfach\operation\step\Step;
12
-use einfach\operation\step\Failure;
13 11
 use einfach\operation\step\AbstractStep;
14 12
 use einfach\operation\step\Always;
13
+use einfach\operation\step\Failure;
14
+use einfach\operation\step\Step;
15 15
 use einfach\operation\step\TryCatch;
16 16
 use einfach\operation\step\Wrap;
17 17
 
Please login to merge, or discard this patch.
src/Result.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -8,6 +8,9 @@
 block discarded – undo
8 8
     protected $finalTrack;
9 9
     protected $pipeline;
10 10
 
11
+    /**
12
+     * @param string $finalTrack
13
+     */
11 14
     function __construct($params, $finalTrack, $pipeline)
12 15
     {
13 16
         $this->params = $params;
Please login to merge, or discard this patch.
src/step/Failure.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@
 block discarded – undo
10 10
     function __invoke(&$params, string $track)
11 11
     {
12 12
         // works only on Error track
13
-        if ($track == Railway::TRACK_FAILURE){
13
+        if ($track == Railway::TRACK_FAILURE) {
14 14
             call_user_func($this->function, $params);
15 15
             // does not respect function return and always back to error track
16 16
             return ['type' => RESPONSE_TYPE_ERROR];
Please login to merge, or discard this patch.
examples/UpdateOperation.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@
 block discarded – undo
55 55
         // pretend I am doing a query
56 56
         // $user = DB::findById($params['id']);
57 57
         $user = (object) ['id' => 123, 'name' => 'Eugene', 'phone' => '111111'];
58
-       return ok(['model' => $user]);
58
+        return ok(['model' => $user]);
59 59
         //return error('User not found!');
60 60
     }
61 61
 
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
     public function __invoke($params)
14 14
     {
15 15
         $result = (new Railway)
16
-            ->step(function ($params) {
16
+            ->step(function($params) {
17 17
                 echo "Hey {$params['name']}. Say hello to anonymous function!";
18 18
                 //return error('Early fail');
19 19
                 return ok(['newParam' => 'newValue']);
@@ -31,9 +31,9 @@  discard block
 block discarded – undo
31 31
         return $result;
32 32
     }
33 33
 
34
-    public function nestedRailway($params){
34
+    public function nestedRailway($params) {
35 35
         return (new Railway)
36
-            ->step(function ($params){
36
+            ->step(function($params) {
37 37
                 return error('Nested Railway failed!');
38 38
                 return ok(['nestedRwParam' => 'nestedRwValue']);
39 39
             })
Please login to merge, or discard this patch.