@@ -24,7 +24,6 @@ |
||
24 | 24 | use PhpBoot\DB\DB; |
25 | 25 | use PhpBoot\DI\DIContainerBuilder; |
26 | 26 | use PhpBoot\DI\Traits\EnableDIAnnotations; |
27 | -use PhpBoot\Lock\LocalAutoLock; |
|
28 | 27 | use PhpBoot\Utils\Logger; |
29 | 28 | use Psr\Container\ContainerExceptionInterface; |
30 | 29 | use Psr\Container\ContainerInterface; |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | $default += [ |
88 | 88 | Cache::class => \DI\object(ApcCache::class) |
89 | 89 | ]; |
90 | - }else{ |
|
90 | + } else{ |
|
91 | 91 | $default += [ |
92 | 92 | Cache::class => \DI\object(FilesystemCache::class) |
93 | 93 | ->constructorParameter('directory', sys_get_temp_dir()) |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | } |
271 | 271 | return $next($request); |
272 | 272 | |
273 | - }elseif ($res[0] == Dispatcher::NOT_FOUND) { |
|
273 | + } elseif ($res[0] == Dispatcher::NOT_FOUND) { |
|
274 | 274 | \PhpBoot\abort(new NotFoundHttpException(), [$request->getMethod(), $uri]); |
275 | 275 | } elseif ($res[0] == Dispatcher::METHOD_NOT_ALLOWED) { |
276 | 276 | \PhpBoot\abort(new MethodNotAllowedHttpException($res[1]), [$request->getMethod(), $uri]); |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | } |
295 | 295 | return $response; |
296 | 296 | |
297 | - }catch (\Exception $e){ |
|
297 | + } catch (\Exception $e){ |
|
298 | 298 | $renderer->render($e); |
299 | 299 | } |
300 | 300 |
@@ -5,7 +5,6 @@ |
||
5 | 5 | use DI\FactoryInterface; |
6 | 6 | use \DI\InvokerInterface as DIInvokerInterface; |
7 | 7 | use Doctrine\Common\Cache\Cache; |
8 | -use PhpBoot\Cache\LocalCacheInterface; |
|
9 | 8 | use PhpBoot\Controller\Annotations\BindAnnotationHandler; |
10 | 9 | use PhpBoot\Controller\Annotations\ClassAnnotationHandler; |
11 | 10 | use PhpBoot\Controller\Annotations\HookAnnotationHandler; |
@@ -45,7 +45,7 @@ |
||
45 | 45 | { |
46 | 46 | if($annotations){ |
47 | 47 | parent::__construct($annotations, $cache); |
48 | - }else{ |
|
48 | + } else{ |
|
49 | 49 | parent::__construct(self::$DEFAULT_ANNOTATIONS, $cache); |
50 | 50 | } |
51 | 51 |
@@ -2,7 +2,6 @@ |
||
2 | 2 | |
3 | 3 | namespace PhpBoot\ORM; |
4 | 4 | |
5 | -use DI\Container; |
|
6 | 5 | use DI\FactoryInterface; |
7 | 6 | use Doctrine\Common\Cache\Cache; |
8 | 7 | use PhpBoot\DI\DIContainerBuilder; |
@@ -9,7 +9,7 @@ |
||
9 | 9 | if(apc_add($key, 1, $ttl)){ |
10 | 10 | $this->locked = true; |
11 | 11 | return true; |
12 | - }else{ |
|
12 | + } else{ |
|
13 | 13 | return false; |
14 | 14 | } |
15 | 15 | } |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | || $p->container instanceof ArrayContainer){ |
29 | 29 | if(!$var){ |
30 | 30 | $var = []; |
31 | - }elseif(is_string($var)){ |
|
31 | + } elseif(is_string($var)){ |
|
32 | 32 | $var = json_decode($var, true); |
33 | 33 | !json_last_error() or \PhpBoot\abort(new \InvalidArgumentException(__METHOD__.' failed while json_decode with '.json_last_error_msg())); |
34 | 34 | } |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | if($p->validation){ |
40 | 40 | if(is_array($p->validation)){ |
41 | 41 | $vld->rule($p->validation[0], $p->name.'.'.$p->validation[1]); |
42 | - }else{ |
|
42 | + } else{ |
|
43 | 43 | $vld->rule($p->validation, $p->name); |
44 | 44 | } |
45 | 45 | } |
@@ -75,10 +75,10 @@ discard block |
||
75 | 75 | foreach ($this->properties as $p){ |
76 | 76 | if($p->isOptional){ |
77 | 77 | $obj->{$p->name} = $p->default; |
78 | - }elseif($p->container){ |
|
78 | + } elseif($p->container){ |
|
79 | 79 | $var = $p->container->makeExample(); |
80 | 80 | $obj->{$p->name} = $var; |
81 | - }else{ |
|
81 | + } else{ |
|
82 | 82 | $obj->{$p->name} = null; |
83 | 83 | } |
84 | 84 |
@@ -36,7 +36,7 @@ |
||
36 | 36 | { |
37 | 37 | if($annotations){ |
38 | 38 | parent::__construct($annotations, $cache); |
39 | - }else{ |
|
39 | + } else{ |
|
40 | 40 | parent::__construct(self::$DEFAULT_ANNOTATIONS, $cache); |
41 | 41 | } |
42 | 42 | $this->factory = $factory; |
@@ -13,15 +13,15 @@ |
||
13 | 13 | $getter = function($type)use($builder){ |
14 | 14 | if(!$type || $type == 'mixed'){ |
15 | 15 | return new MixedTypeContainer(); |
16 | - }elseif (TypeHint::isScalarType($type)){ |
|
16 | + } elseif (TypeHint::isScalarType($type)){ |
|
17 | 17 | return new ScalarTypeContainer($type); |
18 | - }else{ |
|
18 | + } else{ |
|
19 | 19 | return $builder->build($type); |
20 | 20 | } |
21 | 21 | }; |
22 | 22 | if(TypeHint::isArray($type)){ |
23 | 23 | $container = ArrayContainer::create($type, $getter); |
24 | - }else{ |
|
24 | + } else{ |
|
25 | 25 | $container = $getter($type); |
26 | 26 | } |
27 | 27 | return $container; |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | $property or \PhpBoot\abort($container->getClassName()." property $target not exist "); |
27 | 27 | if($params->count()>1){ |
28 | 28 | $property->validation = [$params->getParam(0), $params->getParam(1)]; |
29 | - }else{ |
|
29 | + } else{ |
|
30 | 30 | $property->validation = $params->getParam(0); |
31 | 31 | if($property->validation){ |
32 | 32 | $v = new Validator(); |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | } |
38 | 38 | } |
39 | 39 | |
40 | - }else{ |
|
40 | + } else{ |
|
41 | 41 | \PhpBoot\abort(new AnnotationSyntaxException( |
42 | 42 | "The annotation \"@{$ann->name} {$ann->description}\" of {$container->getClassName()}::{$ann->parent->name} require 1 param, 0 given" |
43 | 43 | )); |
@@ -37,7 +37,7 @@ |
||
37 | 37 | // TODO 防止递归死循环 |
38 | 38 | $property->container = ContainerFactory::create($builder, $property->type); |
39 | 39 | } |
40 | - }else{ |
|
40 | + } else{ |
|
41 | 41 | \PhpBoot\abort(new AnnotationSyntaxException( |
42 | 42 | "The annotation \"@{$ann->name} {$ann->description}\" of {$container->getClassName()}::{$ann->parent->name} require 1 param, 0 given" |
43 | 43 | )); |