@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | // +---------------------------------------------------------------------- |
9 | 9 | // | Author: liu21st <[email protected]> |
10 | 10 | // +---------------------------------------------------------------------- |
11 | -declare (strict_types = 1); |
|
11 | +declare(strict_types=1); |
|
12 | 12 | |
13 | 13 | namespace think\route\dispatch; |
14 | 14 | |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | |
54 | 54 | if (strpos($controller, '.')) { |
55 | 55 | $pos = strrpos($controller, '.'); |
56 | - $this->controller = substr($controller, 0, $pos) . '.' . Str::studly(substr($controller, $pos + 1)); |
|
56 | + $this->controller = substr($controller, 0, $pos).'.'.Str::studly(substr($controller, $pos + 1)); |
|
57 | 57 | } else { |
58 | 58 | $this->controller = Str::studly($controller); |
59 | 59 | } |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | // 实例化控制器 |
74 | 74 | $instance = $this->controller($this->controller); |
75 | 75 | } catch (ClassNotFoundException $e) { |
76 | - throw new HttpException(404, 'controller not exists:' . $e->getClass()); |
|
76 | + throw new HttpException(404, 'controller not exists:'.$e->getClass()); |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | // 注册控制器中间件 |
@@ -81,9 +81,9 @@ discard block |
||
81 | 81 | |
82 | 82 | return $this->app->middleware->pipeline('controller') |
83 | 83 | ->send($this->request) |
84 | - ->then(function () use ($instance) { |
|
84 | + ->then(function() use ($instance) { |
|
85 | 85 | // 获取当前操作名 |
86 | - $action = $this->actionName . $this->rule->config('action_suffix'); |
|
86 | + $action = $this->actionName.$this->rule->config('action_suffix'); |
|
87 | 87 | |
88 | 88 | if (is_callable([$instance, $action])) { |
89 | 89 | $vars = $this->request->param(); |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | } |
100 | 100 | } else { |
101 | 101 | // 操作不存在 |
102 | - throw new HttpException(404, 'method not exists:' . get_class($instance) . '->' . $action . '()'); |
|
102 | + throw new HttpException(404, 'method not exists:'.get_class($instance).'->'.$action.'()'); |
|
103 | 103 | } |
104 | 104 | |
105 | 105 | $data = $this->app->invokeReflectMethod($instance, $reflect, $vars); |
@@ -126,11 +126,11 @@ discard block |
||
126 | 126 | |
127 | 127 | foreach ($middlewares as $key => $val) { |
128 | 128 | if (!is_int($key)) { |
129 | - if (isset($val['only']) && !in_array($this->request->action(true), array_map(function ($item) { |
|
129 | + if (isset($val['only']) && !in_array($this->request->action(true), array_map(function($item) { |
|
130 | 130 | return strtolower($item); |
131 | 131 | }, is_string($val['only']) ? explode(",", $val['only']) : $val['only']))) { |
132 | 132 | continue; |
133 | - } elseif (isset($val['except']) && in_array($this->request->action(true), array_map(function ($item) { |
|
133 | + } elseif (isset($val['except']) && in_array($this->request->action(true), array_map(function($item) { |
|
134 | 134 | return strtolower($item); |
135 | 135 | }, is_string($val['except']) ? explode(',', $val['except']) : $val['except']))) { |
136 | 136 | continue; |
@@ -162,14 +162,14 @@ discard block |
||
162 | 162 | $controllerLayer = $this->rule->config('controller_layer') ?: 'controller'; |
163 | 163 | $emptyController = $this->rule->config('empty_controller') ?: 'Error'; |
164 | 164 | |
165 | - $class = $this->app->parseClass($controllerLayer, $name . $suffix); |
|
165 | + $class = $this->app->parseClass($controllerLayer, $name.$suffix); |
|
166 | 166 | |
167 | 167 | if (class_exists($class)) { |
168 | 168 | return $this->app->make($class, [], true); |
169 | - } elseif ($emptyController && class_exists($emptyClass = $this->app->parseClass($controllerLayer, $emptyController . $suffix))) { |
|
169 | + } elseif ($emptyController && class_exists($emptyClass = $this->app->parseClass($controllerLayer, $emptyController.$suffix))) { |
|
170 | 170 | return $this->app->make($emptyClass, [], true); |
171 | 171 | } |
172 | 172 | |
173 | - throw new ClassNotFoundException('class not exists:' . $class, $class); |
|
173 | + throw new ClassNotFoundException('class not exists:'.$class, $class); |
|
174 | 174 | } |
175 | 175 | } |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | // +---------------------------------------------------------------------- |
9 | 9 | // | Author: liu21st <[email protected]> |
10 | 10 | // +---------------------------------------------------------------------- |
11 | -declare (strict_types = 1); |
|
11 | +declare(strict_types=1); |
|
12 | 12 | |
13 | 13 | namespace think\route; |
14 | 14 | |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | } |
191 | 191 | } |
192 | 192 | } elseif (false === strpos($domain, '.') && 0 !== strpos($domain, $rootDomain)) { |
193 | - $domain .= '.' . $rootDomain; |
|
193 | + $domain .= '.'.$rootDomain; |
|
194 | 194 | } |
195 | 195 | |
196 | 196 | if (false !== strpos($domain, '://')) { |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | $scheme = $this->https || $request->isSsl() ? 'https://' : 'http://'; |
200 | 200 | } |
201 | 201 | |
202 | - return $scheme . $domain; |
|
202 | + return $scheme.$domain; |
|
203 | 203 | } |
204 | 204 | |
205 | 205 | /** |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | } |
219 | 219 | } |
220 | 220 | |
221 | - return (empty($suffix) || 0 === strpos($suffix, '.')) ? (string) $suffix : '.' . $suffix; |
|
221 | + return (empty($suffix) || 0 === strpos($suffix, '.')) ? (string) $suffix : '.'.$suffix; |
|
222 | 222 | } |
223 | 223 | |
224 | 224 | /** |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | $action = array_pop($path); |
249 | 249 | $controller = empty($path) ? $controller : array_pop($path); |
250 | 250 | |
251 | - $url = $controller . '/' . $action; |
|
251 | + $url = $controller.'/'.$action; |
|
252 | 252 | } |
253 | 253 | |
254 | 254 | return $url; |
@@ -295,7 +295,7 @@ discard block |
||
295 | 295 | { |
296 | 296 | $request = $this->app->request; |
297 | 297 | if (is_string($allowDomain) && false === strpos($allowDomain, '.')) { |
298 | - $allowDomain .= '.' . $request->rootDomain(); |
|
298 | + $allowDomain .= '.'.$request->rootDomain(); |
|
299 | 299 | } |
300 | 300 | $port = $request->port(); |
301 | 301 | |
@@ -314,7 +314,7 @@ discard block |
||
314 | 314 | } |
315 | 315 | |
316 | 316 | if ($port && !in_array($port, [80, 443])) { |
317 | - $domain .= ':' . $port; |
|
317 | + $domain .= ':'.$port; |
|
318 | 318 | } |
319 | 319 | |
320 | 320 | if (empty($pattern)) { |
@@ -325,12 +325,12 @@ discard block |
||
325 | 325 | |
326 | 326 | foreach ($pattern as $key => $val) { |
327 | 327 | if (isset($vars[$key])) { |
328 | - $url = str_replace(['[:' . $key . ']', '<' . $key . '?>', ':' . $key, '<' . $key . '>'], $type ? $vars[$key] : urlencode((string) $vars[$key]), $url); |
|
328 | + $url = str_replace(['[:'.$key.']', '<'.$key.'?>', ':'.$key, '<'.$key.'>'], $type ? $vars[$key] : urlencode((string) $vars[$key]), $url); |
|
329 | 329 | unset($vars[$key]); |
330 | 330 | $url = str_replace(['/?', '-?'], ['/', '-'], $url); |
331 | 331 | $result = [rtrim($url, '?/-'), $domain, $suffix]; |
332 | 332 | } elseif (2 == $val) { |
333 | - $url = str_replace(['/[:' . $key . ']', '[:' . $key . ']', '<' . $key . '?>'], '', $url); |
|
333 | + $url = str_replace(['/[:'.$key.']', '[:'.$key.']', '<'.$key.'?>'], '', $url); |
|
334 | 334 | $url = str_replace(['/?', '-?'], ['/', '-'], $url); |
335 | 335 | $result = [rtrim($url, '?/-'), $domain, $suffix]; |
336 | 336 | } else { |
@@ -358,7 +358,7 @@ discard block |
||
358 | 358 | if (0 === strpos($url, '[') && $pos = strpos($url, ']')) { |
359 | 359 | // [name] 表示使用路由命名标识生成URL |
360 | 360 | $name = substr($url, 1, $pos - 1); |
361 | - $url = 'name' . substr($url, $pos + 1); |
|
361 | + $url = 'name'.substr($url, $pos + 1); |
|
362 | 362 | } |
363 | 363 | |
364 | 364 | if (false === strpos($url, '://') && 0 !== strpos($url, '/')) { |
@@ -385,7 +385,7 @@ discard block |
||
385 | 385 | } |
386 | 386 | |
387 | 387 | if ($url) { |
388 | - $checkName = isset($name) ? $name : $url . (isset($info['query']) ? '?' . $info['query'] : ''); |
|
388 | + $checkName = isset($name) ? $name : $url.(isset($info['query']) ? '?'.$info['query'] : ''); |
|
389 | 389 | $checkDomain = $domain && is_string($domain) ? $domain : null; |
390 | 390 | |
391 | 391 | $rule = $this->route->getName($checkName, $checkDomain); |
@@ -411,7 +411,7 @@ discard block |
||
411 | 411 | $suffix = $match[2]; |
412 | 412 | } |
413 | 413 | } elseif (!empty($rule) && isset($name)) { |
414 | - throw new \InvalidArgumentException('route name not exists:' . $name); |
|
414 | + throw new \InvalidArgumentException('route name not exists:'.$name); |
|
415 | 415 | } else { |
416 | 416 | // 检测URL绑定 |
417 | 417 | $bind = $this->route->getDomainBind($domain && is_string($domain) ? $domain : null); |
@@ -449,7 +449,7 @@ discard block |
||
449 | 449 | $file = str_replace('\\', '/', dirname($file)); |
450 | 450 | } |
451 | 451 | |
452 | - $url = rtrim($file, '/') . '/' . $url; |
|
452 | + $url = rtrim($file, '/').'/'.$url; |
|
453 | 453 | |
454 | 454 | // URL后缀 |
455 | 455 | if ('/' == substr($url, -1) || '' == $url) { |
@@ -459,33 +459,33 @@ discard block |
||
459 | 459 | } |
460 | 460 | |
461 | 461 | // 锚点 |
462 | - $anchor = !empty($anchor) ? '#' . $anchor : ''; |
|
462 | + $anchor = !empty($anchor) ? '#'.$anchor : ''; |
|
463 | 463 | |
464 | 464 | // 参数组装 |
465 | 465 | if (!empty($vars)) { |
466 | 466 | // 添加参数 |
467 | 467 | if ($this->route->config('url_common_param')) { |
468 | 468 | $vars = http_build_query($vars); |
469 | - $url .= $suffix . '?' . $vars . $anchor; |
|
469 | + $url .= $suffix.'?'.$vars.$anchor; |
|
470 | 470 | } else { |
471 | 471 | foreach ($vars as $var => $val) { |
472 | 472 | $val = (string) $val; |
473 | 473 | if ('' !== $val) { |
474 | - $url .= $depr . $var . $depr . urlencode($val); |
|
474 | + $url .= $depr.$var.$depr.urlencode($val); |
|
475 | 475 | } |
476 | 476 | } |
477 | 477 | |
478 | - $url .= $suffix . $anchor; |
|
478 | + $url .= $suffix.$anchor; |
|
479 | 479 | } |
480 | 480 | } else { |
481 | - $url .= $suffix . $anchor; |
|
481 | + $url .= $suffix.$anchor; |
|
482 | 482 | } |
483 | 483 | |
484 | 484 | // 检测域名 |
485 | 485 | $domain = $this->parseDomain($url, $domain); |
486 | 486 | |
487 | 487 | // URL组装 |
488 | - return $domain . rtrim($this->root, '/') . '/' . ltrim($url, '/'); |
|
488 | + return $domain.rtrim($this->root, '/').'/'.ltrim($url, '/'); |
|
489 | 489 | } |
490 | 490 | |
491 | 491 | public function __toString() |
@@ -118,7 +118,7 @@ |
||
118 | 118 | */ |
119 | 119 | public function setId($id = null): void |
120 | 120 | { |
121 | - $this->id = is_string($id) && strlen($id) === 32 ? $id : md5(microtime(true) . uniqid('', true)); |
|
121 | + $this->id = is_string($id) && strlen($id) === 32 ? $id : md5(microtime(true).uniqid('', true)); |
|
122 | 122 | } |
123 | 123 | |
124 | 124 | /** |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | // +---------------------------------------------------------------------- |
9 | 9 | // | Author: liu21st <[email protected]> |
10 | 10 | // +---------------------------------------------------------------------- |
11 | -declare (strict_types = 1); |
|
11 | +declare(strict_types=1); |
|
12 | 12 | |
13 | 13 | namespace think; |
14 | 14 | |
@@ -160,9 +160,9 @@ discard block |
||
160 | 160 | $this->ruleName = new RuleName(); |
161 | 161 | $this->setDefaultDomain(); |
162 | 162 | |
163 | - if (is_file($this->app->getRuntimePath() . 'route.php')) { |
|
163 | + if (is_file($this->app->getRuntimePath().'route.php')) { |
|
164 | 164 | // 读取路由映射文件 |
165 | - $this->import(include $this->app->getRuntimePath() . 'route.php'); |
|
165 | + $this->import(include $this->app->getRuntimePath().'route.php'); |
|
166 | 166 | } |
167 | 167 | } |
168 | 168 | |
@@ -392,14 +392,14 @@ discard block |
||
392 | 392 | if (is_null($domain)) { |
393 | 393 | $domain = $this->host; |
394 | 394 | } elseif (false === strpos($domain, '.') && $this->request) { |
395 | - $domain .= '.' . $this->request->rootDomain(); |
|
395 | + $domain .= '.'.$this->request->rootDomain(); |
|
396 | 396 | } |
397 | 397 | |
398 | 398 | if ($this->request) { |
399 | 399 | $subDomain = $this->request->subDomain(); |
400 | 400 | |
401 | 401 | if (strpos($subDomain, '.')) { |
402 | - $name = '*' . strstr($subDomain, '.'); |
|
402 | + $name = '*'.strstr($subDomain, '.'); |
|
403 | 403 | } |
404 | 404 | } |
405 | 405 | |
@@ -743,7 +743,7 @@ discard block |
||
743 | 743 | |
744 | 744 | return $this->app->middleware->pipeline('route') |
745 | 745 | ->send($request) |
746 | - ->then(function () use ($dispatch) { |
|
746 | + ->then(function() use ($dispatch) { |
|
747 | 747 | return $dispatch->run(); |
748 | 748 | }); |
749 | 749 | } |
@@ -792,10 +792,10 @@ discard block |
||
792 | 792 | $path = $pathinfo; |
793 | 793 | } elseif ($suffix) { |
794 | 794 | // 去除正常的URL后缀 |
795 | - $path = preg_replace('/\.(' . ltrim($suffix, '.') . ')$/i', '', $pathinfo); |
|
795 | + $path = preg_replace('/\.('.ltrim($suffix, '.').')$/i', '', $pathinfo); |
|
796 | 796 | } else { |
797 | 797 | // 允许任何后缀访问 |
798 | - $path = preg_replace('/\.' . $this->request->ext() . '$/i', '', $pathinfo); |
|
798 | + $path = preg_replace('/\.'.$this->request->ext().'$/i', '', $pathinfo); |
|
799 | 799 | } |
800 | 800 | |
801 | 801 | return $path; |
@@ -838,9 +838,9 @@ discard block |
||
838 | 838 | $item = $this->domains[$this->host]; |
839 | 839 | } elseif (isset($this->domains[$subDomain])) { |
840 | 840 | $item = $this->domains[$subDomain]; |
841 | - } elseif (isset($this->domains['*.' . $domain2]) && !empty($domain3)) { |
|
841 | + } elseif (isset($this->domains['*.'.$domain2]) && !empty($domain3)) { |
|
842 | 842 | // 泛三级域名 |
843 | - $item = $this->domains['*.' . $domain2]; |
|
843 | + $item = $this->domains['*.'.$domain2]; |
|
844 | 844 | $panDomain = $domain3; |
845 | 845 | } elseif (isset($this->domains['*']) && !empty($domain2)) { |
846 | 846 | // 泛二级域名 |
@@ -30,18 +30,18 @@ discard block |
||
30 | 30 | |
31 | 31 | protected function execute(Input $input, Output $output) |
32 | 32 | { |
33 | - $runtimePath = $this->app->getRootPath() . 'runtime' . DIRECTORY_SEPARATOR; |
|
33 | + $runtimePath = $this->app->getRootPath().'runtime'.DIRECTORY_SEPARATOR; |
|
34 | 34 | |
35 | 35 | if ($input->getOption('cache')) { |
36 | - $path = $runtimePath . 'cache'; |
|
36 | + $path = $runtimePath.'cache'; |
|
37 | 37 | } elseif ($input->getOption('log')) { |
38 | - $path = $runtimePath . 'log'; |
|
38 | + $path = $runtimePath.'log'; |
|
39 | 39 | } else { |
40 | 40 | $path = $input->getOption('path') ?: $runtimePath; |
41 | 41 | } |
42 | 42 | |
43 | 43 | $rmdir = $input->getOption('dir') ? true : false; |
44 | - $this->clear(rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR, $rmdir); |
|
44 | + $this->clear(rtrim($path, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR, $rmdir); |
|
45 | 45 | |
46 | 46 | $output->writeln("<info>Clear Successed</info>"); |
47 | 47 | } |
@@ -51,13 +51,13 @@ discard block |
||
51 | 51 | $files = is_dir($path) ? scandir($path) : []; |
52 | 52 | |
53 | 53 | foreach ($files as $file) { |
54 | - if ('.' != $file && '..' != $file && is_dir($path . $file)) { |
|
55 | - array_map('unlink', glob($path . $file . DIRECTORY_SEPARATOR . '*.*')); |
|
54 | + if ('.' != $file && '..' != $file && is_dir($path.$file)) { |
|
55 | + array_map('unlink', glob($path.$file.DIRECTORY_SEPARATOR.'*.*')); |
|
56 | 56 | if ($rmdir) { |
57 | - rmdir($path . $file); |
|
57 | + rmdir($path.$file); |
|
58 | 58 | } |
59 | - } elseif ('.gitignore' != $file && is_file($path . $file)) { |
|
60 | - unlink($path . $file); |
|
59 | + } elseif ('.gitignore' != $file && is_file($path.$file)) { |
|
60 | + unlink($path.$file); |
|
61 | 61 | } |
62 | 62 | } |
63 | 63 | } |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | // +---------------------------------------------------------------------- |
9 | 9 | // | Author: yunwuxin <[email protected]> |
10 | 10 | // +---------------------------------------------------------------------- |
11 | -declare (strict_types = 1); |
|
11 | +declare(strict_types=1); |
|
12 | 12 | |
13 | 13 | namespace think; |
14 | 14 | |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | protected function resolveClass(string $type): string |
94 | 94 | { |
95 | 95 | if ($this->namespace || false !== strpos($type, '\\')) { |
96 | - $class = false !== strpos($type, '\\') ? $type : $this->namespace . Str::studly($type); |
|
96 | + $class = false !== strpos($type, '\\') ? $type : $this->namespace.Str::studly($type); |
|
97 | 97 | |
98 | 98 | if (class_exists($class)) { |
99 | 99 | return $class; |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | { |
126 | 126 | $type = $this->resolveType($name); |
127 | 127 | |
128 | - $method = 'create' . Str::studly($type) . 'Driver'; |
|
128 | + $method = 'create'.Str::studly($type).'Driver'; |
|
129 | 129 | |
130 | 130 | $params = $this->resolveParams($name); |
131 | 131 |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | // +---------------------------------------------------------------------- |
9 | 9 | // | Author: liu21st <[email protected]> |
10 | 10 | // +---------------------------------------------------------------------- |
11 | -declare (strict_types = 1); |
|
11 | +declare(strict_types=1); |
|
12 | 12 | |
13 | 13 | namespace think; |
14 | 14 | |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | return $this->make($abstract); |
131 | 131 | } |
132 | 132 | |
133 | - throw new ClassNotFoundException('class not exists: ' . $abstract, $abstract); |
|
133 | + throw new ClassNotFoundException('class not exists: '.$abstract, $abstract); |
|
134 | 134 | } |
135 | 135 | |
136 | 136 | /** |
@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | { |
305 | 305 | if (is_array($method)) { |
306 | 306 | [$class, $method] = $method; |
307 | - $class = is_object($class) ? $class : $this->invokeClass($class); |
|
307 | + $class = is_object($class) ? $class : $this->invokeClass($class); |
|
308 | 308 | } else { |
309 | 309 | // 静态方法 |
310 | 310 | [$class, $method] = explode('::', $method); |
@@ -373,7 +373,7 @@ discard block |
||
373 | 373 | try { |
374 | 374 | $reflect = new ReflectionClass($class); |
375 | 375 | } catch (ReflectionException $e) { |
376 | - throw new ClassNotFoundException('class not exists: ' . $class, $class, $e); |
|
376 | + throw new ClassNotFoundException('class not exists: '.$class, $class, $e); |
|
377 | 377 | } |
378 | 378 | |
379 | 379 | if ($reflect->hasMethod('__make')) { |
@@ -452,7 +452,7 @@ discard block |
||
452 | 452 | } elseif ($param->isDefaultValueAvailable()) { |
453 | 453 | $args[] = $param->getDefaultValue(); |
454 | 454 | } else { |
455 | - throw new InvalidArgumentException('method param miss:' . $name); |
|
455 | + throw new InvalidArgumentException('method param miss:'.$name); |
|
456 | 456 | } |
457 | 457 | } |
458 | 458 | |
@@ -470,7 +470,7 @@ discard block |
||
470 | 470 | */ |
471 | 471 | public static function factory(string $name, string $namespace = '', ...$args) |
472 | 472 | { |
473 | - $class = false !== strpos($name, '\\') ? $name : $namespace . ucwords($name); |
|
473 | + $class = false !== strpos($name, '\\') ? $name : $namespace.ucwords($name); |
|
474 | 474 | |
475 | 475 | return Container::getInstance()->invokeClass($class, $args); |
476 | 476 | } |
@@ -13,7 +13,7 @@ |
||
13 | 13 | public function __construct(string $message, string $func = '', Throwable $previous = null) |
14 | 14 | { |
15 | 15 | $this->message = $message; |
16 | - $this->func = $func; |
|
16 | + $this->func = $func; |
|
17 | 17 | |
18 | 18 | parent::__construct($message, 0, $previous); |
19 | 19 | } |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | |
64 | 64 | Container::setInstance($container); |
65 | 65 | |
66 | - $container->bind('name', function () { |
|
66 | + $container->bind('name', function() { |
|
67 | 67 | return 'Taylor'; |
68 | 68 | }); |
69 | 69 | |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | $this->expectExceptionMessage('class not exists: name'); |
81 | 81 | $container->get('name'); |
82 | 82 | |
83 | - $container->bind('name', function () { |
|
83 | + $container->bind('name', function() { |
|
84 | 84 | return 'Taylor'; |
85 | 85 | }); |
86 | 86 | |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | { |
92 | 92 | $container = new Container; |
93 | 93 | |
94 | - $container->bind('name', function () { |
|
94 | + $container->bind('name', function() { |
|
95 | 95 | return 'Taylor'; |
96 | 96 | }); |
97 | 97 | |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | { |
107 | 107 | $container = new Container; |
108 | 108 | |
109 | - $container->bind('name', function () { |
|
109 | + $container->bind('name', function() { |
|
110 | 110 | return 'Taylor'; |
111 | 111 | }); |
112 | 112 | |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | |
199 | 199 | $this->assertSame($object, Container::getInstance()); |
200 | 200 | |
201 | - Container::setInstance(function () { |
|
201 | + Container::setInstance(function() { |
|
202 | 202 | return $this; |
203 | 203 | }); |
204 | 204 | |
@@ -210,10 +210,10 @@ discard block |
||
210 | 210 | $container = new Container(); |
211 | 211 | $container->bind(Container::class, $container); |
212 | 212 | |
213 | - $container->resolving(function (SomeClass $taylor, Container $container) { |
|
213 | + $container->resolving(function(SomeClass $taylor, Container $container) { |
|
214 | 214 | $taylor->count++; |
215 | 215 | }); |
216 | - $container->resolving(SomeClass::class, function (SomeClass $taylor, Container $container) { |
|
216 | + $container->resolving(SomeClass::class, function(SomeClass $taylor, Container $container) { |
|
217 | 217 | $taylor->count++; |
218 | 218 | }); |
219 | 219 | |
@@ -252,19 +252,19 @@ discard block |
||
252 | 252 | |
253 | 253 | $this->assertEquals('48', $container->invoke('ord', ['0'])); |
254 | 254 | |
255 | - $this->assertSame($container, $container->invoke(Taylor::class . '::test', [])); |
|
255 | + $this->assertSame($container, $container->invoke(Taylor::class.'::test', [])); |
|
256 | 256 | |
257 | - $this->assertSame($container, $container->invokeMethod(Taylor::class . '::test')); |
|
257 | + $this->assertSame($container, $container->invokeMethod(Taylor::class.'::test')); |
|
258 | 258 | |
259 | 259 | $reflect = new ReflectionMethod($container, 'exists'); |
260 | 260 | |
261 | 261 | $this->assertTrue($container->invokeReflectMethod($container, $reflect, [Container::class])); |
262 | 262 | |
263 | - $this->assertSame($container, $container->invoke(function (Container $container) { |
|
263 | + $this->assertSame($container, $container->invoke(function(Container $container) { |
|
264 | 264 | return $container; |
265 | 265 | })); |
266 | 266 | |
267 | - $this->assertSame($container, $container->invoke(Taylor::class . '::test')); |
|
267 | + $this->assertSame($container, $container->invoke(Taylor::class.'::test')); |
|
268 | 268 | |
269 | 269 | $object = $container->invokeClass(SomeClass::class); |
270 | 270 | $this->assertInstanceOf(SomeClass::class, $object); |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | |
273 | 273 | $stdClass = new stdClass(); |
274 | 274 | |
275 | - $container->invoke(function (Container $container, stdClass $stdObject, $key1, $lowKey, $key2 = 'default') use ($stdClass) { |
|
275 | + $container->invoke(function(Container $container, stdClass $stdObject, $key1, $lowKey, $key2 = 'default') use ($stdClass) { |
|
276 | 276 | $this->assertEquals('value1', $key1); |
277 | 277 | $this->assertEquals('default', $key2); |
278 | 278 | $this->assertEquals('value2', $lowKey); |