@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | |
| 44 | 44 | public function __construct(array $methods, string $uri, array $attribute = []) |
| 45 | 45 | { |
| 46 | - array_walk($methods, function ($value) { |
|
| 46 | + array_walk($methods, function($value) { |
|
| 47 | 47 | return strtoupper($value); |
| 48 | 48 | }); |
| 49 | 49 | $this->methods = $methods; |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | * @param string $uri |
| 161 | 161 | * @return array|null |
| 162 | 162 | */ |
| 163 | - public function match(string $method, string $uri):?array |
|
| 163 | + public function match(string $method, string $uri): ?array |
|
| 164 | 164 | { |
| 165 | 165 | if (count($this->methods) > 0 && !in_array($method, $this->methods)) { |
| 166 | 166 | return null; |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | */ |
| 97 | 97 | public function loadVendorIfExist() |
| 98 | 98 | { |
| 99 | - $vendorAutoload = $this->application->getPath() . '/vendor/autoload.php'; |
|
| 99 | + $vendorAutoload = $this->application->getPath().'/vendor/autoload.php'; |
|
| 100 | 100 | if (FileSystem::exist($vendorAutoload)) { |
| 101 | 101 | Loader::requireOnce($vendorAutoload); |
| 102 | 102 | } |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | */ |
| 144 | 144 | protected function registerModule() |
| 145 | 145 | { |
| 146 | - $extractPath = $this->application->getDataPath() . '/extract-module'; |
|
| 146 | + $extractPath = $this->application->getDataPath().'/extract-module'; |
|
| 147 | 147 | FileSystem::make($extractPath); |
| 148 | 148 | foreach ($this->application->getModulePaths() as $path) { |
| 149 | 149 | $this->registerModuleFrom($path, $extractPath); |
@@ -71,13 +71,13 @@ discard block |
||
| 71 | 71 | ); |
| 72 | 72 | $exported = []; |
| 73 | 73 | foreach ($props as $value) { |
| 74 | - $name = dechex($value->getModifiers()) . '$' . $value->getName(); |
|
| 74 | + $name = dechex($value->getModifiers()).'$'.$value->getName(); |
|
| 75 | 75 | $value->setAccessible(true); |
| 76 | 76 | $exported[$name] = new DebugObject($value->getValue($object), $this->context); |
| 77 | 77 | } |
| 78 | 78 | return $exported; |
| 79 | 79 | } catch (ReflectionException $e) { |
| 80 | - return 'Err:' . $e->getMessage(); |
|
| 80 | + return 'Err:'.$e->getMessage(); |
|
| 81 | 81 | } |
| 82 | 82 | } |
| 83 | 83 | |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | public function jsonSerialize() |
| 87 | 87 | { |
| 88 | 88 | if (is_object($this->value)) { |
| 89 | - if ($this->value instanceof self){ |
|
| 89 | + if ($this->value instanceof self) { |
|
| 90 | 90 | return [ |
| 91 | 91 | '_type' => self::class, |
| 92 | 92 | '_properties' => $this->value, |
@@ -120,7 +120,7 @@ |
||
| 120 | 120 | * @return Iterator |
| 121 | 121 | */ |
| 122 | 122 | protected function getCallbackIterator(string $name, bool $reverse = false): Iterator { |
| 123 | - return $reverse?new ArrayIterator(array_reverse($this->queue[$name])):new ArrayIterator($this->queue[$name]); |
|
| 123 | + return $reverse ? new ArrayIterator(array_reverse($this->queue[$name])) : new ArrayIterator($this->queue[$name]); |
|
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | /** |
@@ -65,9 +65,9 @@ |
||
| 65 | 65 | $desc = $info['description']; |
| 66 | 66 | $ms = number_format($time * 1000, 3, '.', ''); |
| 67 | 67 | if (strlen($desc)) { |
| 68 | - $timing[] = $name . ';desc="' . $desc . '";dur=' . $ms; |
|
| 68 | + $timing[] = $name.';desc="'.$desc.'";dur='.$ms; |
|
| 69 | 69 | } else { |
| 70 | - $timing[] = $name . ';dur=' . $ms; |
|
| 70 | + $timing[] = $name.';dur='.$ms; |
|
| 71 | 71 | } |
| 72 | 72 | } |
| 73 | 73 | $response->setHeader('server-timing', implode(',', $timing)); |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | $this->config = $config; |
| 79 | 79 | $this->name = $name ?? 'anonymous'; |
| 80 | 80 | $this->observer = new NullObserver; |
| 81 | - register_shutdown_function(function () { |
|
| 81 | + register_shutdown_function(function() { |
|
| 82 | 82 | $this->onBeforeSystemShutdown(); |
| 83 | 83 | }); |
| 84 | 84 | } |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | $this->pdo = $this->createPDO(); |
| 109 | 109 | $this->observer->connectDatabase(microtime(true) - $time); |
| 110 | 110 | $this->id = static::$connectionCount; |
| 111 | - static::$connectionCount ++; |
|
| 111 | + static::$connectionCount++; |
|
| 112 | 112 | } catch (PDOException $e) { |
| 113 | 113 | throw new SQLException(sprintf( |
| 114 | 114 | "%s connect database error:%s", |
@@ -200,7 +200,7 @@ discard block |
||
| 200 | 200 | public function beginTransaction() |
| 201 | 201 | { |
| 202 | 202 | $this->prepareConnection(); |
| 203 | - $this->transaction ++; |
|
| 203 | + $this->transaction++; |
|
| 204 | 204 | if ($this->transaction == 1) { |
| 205 | 205 | $this->pdo->beginTransaction(); |
| 206 | 206 | } |