Passed
Push — master ( 84fc10...8e4488 )
by 世昌
02:46
created
nebula/runnable/target/TargetBuilder.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
         if ($fileStart === 0) {
24 24
             return new FileTarget(substr($command, 1));
25 25
         }
26
-        $requireFile = substr($command, $fileStart+1);
26
+        $requireFile = substr($command, $fileStart + 1);
27 27
         $command = substr($command, 0, $fileStart);
28 28
         // for parameter list
29 29
         list($command, $parameter) = self::splitParameter($command);
@@ -34,12 +34,12 @@  discard block
 block discarded – undo
34 34
         $dynmicsMethod;
35 35
         $parameter = self::buildParameter($parameter);
36 36
         if ($methodStart > 0) {
37
-            $splitLength = $splitLength > 0 ? 1:2;
37
+            $splitLength = $splitLength > 0 ? 1 : 2;
38 38
             $methodName = substr($command, $methodStart + $splitLength);
39 39
             $command = substr($command, 0, $methodStart);
40 40
             list($className, $constructParameter) = self::splitParameter($command);
41 41
             $constructParameter = self::buildParameter($constructParameter);
42
-            $target = new MethodTarget($className, $dynmicsMethod? $constructParameter :null, $methodName, $parameter);
42
+            $target = new MethodTarget($className, $dynmicsMethod ? $constructParameter : null, $methodName, $parameter);
43 43
         } else {
44 44
             $target = new FunctionTarget(self::buildName($command), $parameter);
45 45
         }
@@ -54,18 +54,18 @@  discard block
 block discarded – undo
54 54
         if (preg_match('/^[\w\\\\\/.]+$/', $name) !== 1) {
55 55
             throw new \Exception(\sprintf('invaild command name: %s ', $name));
56 56
         }
57
-        return  str_replace(['.','/'], '\\', $name);
57
+        return  str_replace(['.', '/'], '\\', $name);
58 58
     }
59 59
 
60 60
     private static function splitParameter(string $command):array
61 61
     {
62 62
         $parameter = null;
63
-        if (strrpos($command, ')') === strlen($command) -1) {
63
+        if (strrpos($command, ')') === strlen($command) - 1) {
64 64
             $paramStart = strpos($command, '(');
65 65
             $parameter = substr($command, $paramStart + 1, strlen($command) - $paramStart - 2);
66 66
             $command = substr($command, 0, $paramStart);
67 67
         }
68
-        return [$command,$parameter];
68
+        return [$command, $parameter];
69 69
     }
70 70
 
71 71
     private static function buildParameter(?string $parameter)
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
             if (strpos($value, ':') === 0) {
85 85
                 $value = base64_decode(substr($value, 1));
86 86
             }
87
-            if ($prefix ==='=j' || $prefix ==='=json') {
87
+            if ($prefix === '=j' || $prefix === '=json') {
88 88
                 $params = json_decode($value);
89 89
                 if (json_last_error() === JSON_ERROR_NONE) {
90 90
                     return $params;
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
         } else {
101 101
             $params = explode(',', trim($param, ','));
102 102
             foreach ($params as $index=>$value) {
103
-                $params[$index]=trim($value);
103
+                $params[$index] = trim($value);
104 104
             }
105 105
             return $params;
106 106
         }
Please login to merge, or discard this patch.