@@ -66,7 +66,7 @@ |
||
| 66 | 66 | if (is_null($this->pdo)) { |
| 67 | 67 | try { |
| 68 | 68 | $this->pdo = new PDO($this->getDsn(), $this->user, $this->password); |
| 69 | - static::$connetionCount ++; |
|
| 69 | + static::$connetionCount++; |
|
| 70 | 70 | } catch (PDOException $e) { |
| 71 | 71 | throw new ConnectionException($e->getMessage(), $e->getCode()); |
| 72 | 72 | } |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | } |
| 53 | 53 | $requireFile = ''; |
| 54 | 54 | if ($fileStart > 0) { |
| 55 | - $requireFile = substr($command, $fileStart+1); |
|
| 55 | + $requireFile = substr($command, $fileStart + 1); |
|
| 56 | 56 | $command = substr($command, 0, $fileStart); |
| 57 | 57 | } |
| 58 | 58 | // for parameter list |
@@ -64,12 +64,12 @@ discard block |
||
| 64 | 64 | $dynmicsMethod; |
| 65 | 65 | $parameter = self::buildParameter($parameter); |
| 66 | 66 | if ($methodStart > 0) { |
| 67 | - $splitLength = $splitLength > 0 ? 1:2; |
|
| 67 | + $splitLength = $splitLength > 0 ? 1 : 2; |
|
| 68 | 68 | $methodName = substr($command, $methodStart + $splitLength); |
| 69 | 69 | $command = substr($command, 0, $methodStart); |
| 70 | 70 | list($className, $constructParameter) = self::splitParameter($command); |
| 71 | 71 | $constructParameter = self::buildParameter($constructParameter); |
| 72 | - $target = new MethodTarget($className, $dynmicsMethod? $constructParameter :null, $methodName, $parameter); |
|
| 72 | + $target = new MethodTarget($className, $dynmicsMethod ? $constructParameter : null, $methodName, $parameter); |
|
| 73 | 73 | } else { |
| 74 | 74 | $target = new FunctionTarget(self::buildName($command), $parameter); |
| 75 | 75 | } |
@@ -86,8 +86,8 @@ discard block |
||
| 86 | 86 | if (is_null($parameter)) { |
| 87 | 87 | return new $classRelName; |
| 88 | 88 | } |
| 89 | - $parameters=self::buildParameter($parameter); |
|
| 90 | - $classRef= new ReflectionClass($classRelName); |
|
| 89 | + $parameters = self::buildParameter($parameter); |
|
| 90 | + $classRef = new ReflectionClass($classRelName); |
|
| 91 | 91 | return $classRef->newInstanceArgs($parameters); |
| 92 | 92 | } |
| 93 | 93 | |
@@ -96,18 +96,18 @@ discard block |
||
| 96 | 96 | if (preg_match('/^[\w\\\\\/.]+$/', $name) !== 1) { |
| 97 | 97 | throw new InvalidNameException(\sprintf('invaild name: %s ', $name)); |
| 98 | 98 | } |
| 99 | - return str_replace(['.','/'], '\\', $name); |
|
| 99 | + return str_replace(['.', '/'], '\\', $name); |
|
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | private static function splitParameter(string $command):array |
| 103 | 103 | { |
| 104 | 104 | $parameter = null; |
| 105 | - if (strrpos($command, ')') === strlen($command) -1) { |
|
| 105 | + if (strrpos($command, ')') === strlen($command) - 1) { |
|
| 106 | 106 | $paramStart = strpos($command, '('); |
| 107 | 107 | $parameter = substr($command, $paramStart + 1, strlen($command) - $paramStart - 2); |
| 108 | 108 | $command = substr($command, 0, $paramStart); |
| 109 | 109 | } |
| 110 | - return [$command,$parameter]; |
|
| 110 | + return [$command, $parameter]; |
|
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | private static function buildParameter(?string $parameter) |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | if (strpos($value, ':') === 0) { |
| 127 | 127 | $value = base64_decode(substr($value, 1)); |
| 128 | 128 | } |
| 129 | - if ($prefix ==='=j' || $prefix ==='=json') { |
|
| 129 | + if ($prefix === '=j' || $prefix === '=json') { |
|
| 130 | 130 | $params = json_decode($value); |
| 131 | 131 | if (json_last_error() === JSON_ERROR_NONE) { |
| 132 | 132 | return $params; |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | } else { |
| 143 | 143 | $params = explode(',', trim($param, ',')); |
| 144 | 144 | foreach ($params as $index=>$value) { |
| 145 | - $params[$index]=trim($value); |
|
| 145 | + $params[$index] = trim($value); |
|
| 146 | 146 | } |
| 147 | 147 | return $params; |
| 148 | 148 | } |