GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Push — master ( a18008...55f271 )
by cao
03:16
created
src/ORM/ModelWithClass.php 3 patches
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
             ->getFirst();
32 32
         if($row){
33 33
             return $this->entity->make($row, false);
34
-        }else{
34
+        } else{
35 35
             return null;
36 36
         }
37 37
     }
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -49,7 +49,6 @@  discard block
 block discarded – undo
49 49
 
50 50
     /**
51 51
      * where 语法见 @see WhereRule
52
-     * @param array|string $expr
53 52
      * @param mixed|null $_
54 53
      * @return \PhpBoot\DB\rules\basic\OrderByRule
55 54
      */
@@ -91,7 +90,7 @@  discard block
 block discarded – undo
91 90
     /**
92 91
      * @param int|string $id
93 92
      * @param array $values
94
-     * @return int updated row count
93
+     * @return \PhpBoot\DB\impls\ExecResult updated row count
95 94
      */
96 95
     public function update($id, $values)
97 96
     {
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -29,9 +29,9 @@  discard block
 block discarded – undo
29 29
             ->from($this->entity->getTable())
30 30
             ->where("`{$this->entity->getPK()}` = ?", $id)
31 31
             ->getFirst();
32
-        if($row){
32
+        if ($row) {
33 33
             return $this->entity->make($row, false);
34
-        }else{
34
+        }else {
35 35
             return null;
36 36
         }
37 37
     }
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
      * @param mixed|null $_
54 54
      * @return \PhpBoot\DB\rules\basic\OrderByRule
55 55
      */
56
-    public function deleteWhere($conditions, $_=null)
56
+    public function deleteWhere($conditions, $_ = null)
57 57
     {
58 58
         $query = $this->db->deleteFrom($this->entity->getTable());
59 59
         return call_user_func_array([$query, 'where'], func_get_args());
@@ -75,12 +75,12 @@  discard block
 block discarded – undo
75 75
      * @param string $_
76 76
      * @return \PhpBoot\DB\rules\select\GroupByRule
77 77
      */
78
-    public function findWhere($conditions=null, $_=null)
78
+    public function findWhere($conditions = null, $_ = null)
79 79
     {
80
-        $query =  $this->db->select($this->getColumns())
80
+        $query = $this->db->select($this->getColumns())
81 81
             ->from($this->entity->getTable());
82
-        $query->context->resultHandler = function ($result){
83
-            foreach ($result as &$i){
82
+        $query->context->resultHandler = function($result) {
83
+            foreach ($result as &$i) {
84 84
                 $i = $this->entity->make($i, false);
85 85
             }
86 86
             return $result;
@@ -107,16 +107,16 @@  discard block
 block discarded – undo
107 107
      * @param string $_
108 108
      * @return \PhpBoot\DB\rules\basic\OrderByRule
109 109
      */
110
-    public function updateWhere($values, $conditions, $_=null)
110
+    public function updateWhere($values, $conditions, $_ = null)
111 111
     {
112
-        $query =  $this->db->update($this->entity->getTable())->set($values);
113
-        return call_user_func_array([$query, 'where'], array_slice(func_get_args(),1));
112
+        $query = $this->db->update($this->entity->getTable())->set($values);
113
+        return call_user_func_array([$query, 'where'], array_slice(func_get_args(), 1));
114 114
     }
115 115
 
116 116
     protected function getColumns()
117 117
     {
118 118
         $columns = [];
119
-        foreach ($this->entity->getProperties() as $p){
119
+        foreach ($this->entity->getProperties() as $p) {
120 120
             $columns[] = $p->name;
121 121
         }
122 122
         return $columns;
Please login to merge, or discard this patch.
src/Metas/ParamMeta.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
  * @package Once\route
13 13
  * 函数参数元信息
14 14
  */
15
-class ParamMeta{
15
+class ParamMeta {
16 16
 
17 17
     /**
18 18
      * ParamMeta constructor.
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
      * @param string $description
27 27
      * @param TypeContainerInterface|null $container
28 28
      */
29
-    public function __construct($name, $source, $type, $isOptional ,$default, $isPassedByReference,$validation, $description="", $container=null){
29
+    public function __construct($name, $source, $type, $isOptional, $default, $isPassedByReference, $validation, $description = "", $container = null) {
30 30
         $this->name = $name;
31 31
         $this->source = $source;
32 32
         $this->type = $type;
Please login to merge, or discard this patch.
src/Metas/PropertyMeta.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
      * @param string $description
21 21
      * @param TypeContainerInterface|null $container
22 22
      */
23
-    public function __construct($name, $type=null, $isOptional=false,$default=null, $validation=null, $summary='', $description='', $container = null){
23
+    public function __construct($name, $type = null, $isOptional = false, $default = null, $validation = null, $summary = '', $description = '', $container = null) {
24 24
         $this->name = $name;
25 25
         $this->type = $type;
26 26
         $this->default = $default;
@@ -54,5 +54,5 @@  discard block
 block discarded – undo
54 54
     /**
55 55
      * @var string
56 56
      */
57
-    public $description='';
57
+    public $description = '';
58 58
 }
59 59
\ No newline at end of file
Please login to merge, or discard this patch.
src/Utils/SerializableFunc.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -7,17 +7,17 @@  discard block
 block discarded – undo
7 7
  * @author caoym
8 8
  *
9 9
  */
10
-class SerializableFunc{
10
+class SerializableFunc {
11 11
     /**
12 12
      * 方法,绑定参数
13 13
      * 如
14 14
      * func,arg1,arg2
15 15
      * array('a','method1'), arg1,arg2
16 16
      */
17
-    public  function __construct(callable $func){
17
+    public  function __construct(callable $func) {
18 18
         $args = func_get_args();
19 19
         $this->func = $func;
20
-        $this->bind = array_slice($args,1);
20
+        $this->bind = array_slice($args, 1);
21 21
     }
22 22
     
23 23
     /**
@@ -25,15 +25,15 @@  discard block
 block discarded – undo
25 25
      * 调用时,将bind参数加在方法的最前面
26 26
      * @return mixed
27 27
      */
28
-    public function __invoke(){
28
+    public function __invoke() {
29 29
         $args = func_get_args();
30 30
         $params = $this->bind;
31
-        foreach ($args as $arg){
31
+        foreach ($args as $arg) {
32 32
             array_push($params, $arg);
33 33
         }
34 34
         $res = call_user_func_array($this->func, $params);
35
-        foreach ($this->next as $next){
36
-            call_user_func_array($next,$args);
35
+        foreach ($this->next as $next) {
36
+            call_user_func_array($next, $args);
37 37
         }
38 38
         return $res;
39 39
     }
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
      * 串行调用
42 42
      * @var callable[]
43 43
      */
44
-    public $next=array();
44
+    public $next = array();
45 45
     private $bind;
46 46
     private $func;
47 47
 }
Please login to merge, or discard this patch.
src/Utils/ArrayHelper.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -15,16 +15,16 @@
 block discarded – undo
15 15
         $keys = explode('.', $key);
16 16
         $keys = array_reverse($keys);
17 17
         $cur = &$arr;
18
-        while($p = array_pop($keys)){
18
+        while ($p = array_pop($keys)) {
19 19
             $cur instanceof \ArrayAccess || is_array($cur) or \PhpBoot\abort(new \InvalidArgumentException('array or object of ArrayAccess required'));
20
-            if(!isset($cur[$p])){
21
-                if(count($keys) == 0){
20
+            if (!isset($cur[$p])) {
21
+                if (count($keys) == 0) {
22 22
                     $cur[$p] = $val;
23
-                }else{
23
+                }else {
24 24
                     $cur[$p] = [];
25 25
                 }
26
-            }else{
27
-                if(count($keys) == 0){
26
+            }else {
27
+                if (count($keys) == 0) {
28 28
                     $cur[$p] = $val;
29 29
                 }
30 30
             }
Please login to merge, or discard this patch.
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,10 +20,10 @@
 block discarded – undo
20 20
             if(!isset($cur[$p])){
21 21
                 if(count($keys) == 0){
22 22
                     $cur[$p] = $val;
23
-                }else{
23
+                } else{
24 24
                     $cur[$p] = [];
25 25
                 }
26
-            }else{
26
+            } else{
27 27
                 if(count($keys) == 0){
28 28
                     $cur[$p] = $val;
29 29
                 }
Please login to merge, or discard this patch.
src/Utils/Logger.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -145,7 +145,7 @@
 block discarded – undo
145 145
      */
146 146
     static public function getDefaultLogger()
147 147
     {
148
-        if(!self::$defaultLogger){
148
+        if (!self::$defaultLogger) {
149 149
             self::$defaultLogger = new \Monolog\Logger('default');
150 150
         }
151 151
         return self::$defaultLogger;
Please login to merge, or discard this patch.
src/Utils/TypeCast.php 2 patches
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -14,46 +14,46 @@
 block discarded – undo
14 14
     {
15 15
         TypeHint::isScalarType($type) or \PhpBoot\abort(new \InvalidArgumentException("$type is not scalar type"));
16 16
 
17
-        if(is_bool($val)){
17
+        if (is_bool($val)) {
18 18
             $val = intval($val);
19
-        }else if($val === null){
19
+        }else if ($val === null) {
20 20
             $map = [
21 21
                 'string'=>'',
22 22
                 'bool'=>false,
23 23
                 'int'=>0,
24 24
                 'float'=>0,
25 25
             ];
26
-            if(isset($map[$type])){
26
+            if (isset($map[$type])) {
27 27
                 $val = $map[$type];
28 28
             }
29 29
         }
30
-        if(is_object($val)){
31
-            try{
30
+        if (is_object($val)) {
31
+            try {
32 32
                 $val = (string)$val;
33
-            }catch (\Exception $e){
33
+            }catch (\Exception $e) {
34 34
                 $className = get_class($val);
35 35
                 \PhpBoot\abort(new \InvalidArgumentException("could not cast value from class $className to {$type}"));
36 36
             }
37 37
 
38 38
         }
39
-        if(is_array($val)){
40
-            $type == 'array' ||  $type =='mixed' || !$type or \PhpBoot\abort(new \InvalidArgumentException("could not cast value from resource to {$type}"));
39
+        if (is_array($val)) {
40
+            $type == 'array' || $type == 'mixed' || !$type or \PhpBoot\abort(new \InvalidArgumentException("could not cast value from resource to {$type}"));
41 41
         }
42
-        if(is_resource($val)) {
42
+        if (is_resource($val)) {
43 43
             \PhpBoot\abort(new \InvalidArgumentException("could not cast value from resource to {$type}"));
44 44
         }
45
-        if(!$validate){
45
+        if (!$validate) {
46 46
             settype($val, $type) or \PhpBoot\abort(new \InvalidArgumentException("cast value($val) to {$type} failed"));
47
-        }else{
47
+        }else {
48 48
             $ori = $val;
49 49
             $oriType = gettype($val);
50 50
             settype($val, $type) or \PhpBoot\abort(new \InvalidArgumentException("cast value($ori) to type {$type} failed"));
51 51
             $newData = $val;
52
-            if(is_bool($newData)){
52
+            if (is_bool($newData)) {
53 53
                 $newData = intval($newData);
54 54
             }
55 55
             settype($newData, $oriType) or \PhpBoot\abort(new \InvalidArgumentException("cast value($ori) to type {$type} failed"));
56
-            if($ori != $newData){
56
+            if ($ori != $newData) {
57 57
                 \PhpBoot\abort(new \InvalidArgumentException("could not cast value($ori) to type {$type}"));
58 58
             }
59 59
         }
Please login to merge, or discard this patch.
Braces   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 
17 17
         if(is_bool($val)){
18 18
             $val = intval($val);
19
-        }else if($val === null){
19
+        } else if($val === null){
20 20
             $map = [
21 21
                 'string'=>'',
22 22
                 'bool'=>false,
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
         if(is_object($val)){
31 31
             try{
32 32
                 $val = (string)$val;
33
-            }catch (\Exception $e){
33
+            } catch (\Exception $e){
34 34
                 $className = get_class($val);
35 35
                 \PhpBoot\abort(new \InvalidArgumentException("could not cast value from class $className to {$type}"));
36 36
             }
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
         }
45 45
         if(!$validate){
46 46
             settype($val, $type) or \PhpBoot\abort(new \InvalidArgumentException("cast value($val) to {$type} failed"));
47
-        }else{
47
+        } else{
48 48
             $ori = $val;
49 49
             $oriType = gettype($val);
50 50
             settype($val, $type) or \PhpBoot\abort(new \InvalidArgumentException("cast value($ori) to type {$type} failed"));
Please login to merge, or discard this patch.
src/Utils/ArrayAdaptor.php 2 patches
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -26,19 +26,19 @@  discard block
 block discarded – undo
26 26
      */
27 27
     public function offsetExists($offset)
28 28
     {
29
-        if(is_array($this->obj)){
29
+        if (is_array($this->obj)) {
30 30
             return array_key_exists($offset, $this->obj);
31
-        }elseif(self::hasProperty($this->obj, $offset)){
31
+        }elseif (self::hasProperty($this->obj, $offset)) {
32 32
             return true;
33
-        }elseif(method_exists($this->obj, 'has')){
33
+        }elseif (method_exists($this->obj, 'has')) {
34 34
             return $this->obj->has($offset);
35
-        }elseif(method_exists($this->obj, $method = 'has'.ucfirst($offset))){
35
+        }elseif (method_exists($this->obj, $method = 'has'.ucfirst($offset))) {
36 36
             return $this->obj->{$method}($offset);
37
-        }elseif(method_exists($this->obj, $method = 'get'.ucfirst($offset))){
37
+        }elseif (method_exists($this->obj, $method = 'get'.ucfirst($offset))) {
38 38
             return $this->obj->{$method}() !== null;
39
-        }elseif(method_exists($this->obj, 'get')){
39
+        }elseif (method_exists($this->obj, 'get')) {
40 40
             return $this->obj->get($offset) !== null;
41
-        }else{
41
+        }else {
42 42
             return false;
43 43
         }
44 44
     }
@@ -55,18 +55,18 @@  discard block
 block discarded – undo
55 55
     public function offsetGet($offset)
56 56
     {
57 57
         $res = null;
58
-        if(is_array($this->obj)){
58
+        if (is_array($this->obj)) {
59 59
             $res = &$this->obj[$offset];
60
-        }elseif(self::hasProperty($this->obj, $offset)){
60
+        }elseif (self::hasProperty($this->obj, $offset)) {
61 61
             $res = &$this->obj->{$offset};
62
-        }elseif(method_exists($this->obj, 'get')){
62
+        }elseif (method_exists($this->obj, 'get')) {
63 63
             $res = $this->obj->get($offset);
64
-        }elseif(method_exists($this->obj, $method = 'get'.ucfirst($offset))){
64
+        }elseif (method_exists($this->obj, $method = 'get'.ucfirst($offset))) {
65 65
             $res = $this->obj->{$method}();
66
-        }else{
66
+        }else {
67 67
             throw new \InvalidArgumentException("offsetGet($offset) failed");
68 68
         }
69
-        if(is_array($res) || is_object($res)){
69
+        if (is_array($res) || is_object($res)) {
70 70
             return new self($res);
71 71
         }
72 72
         return $res;
@@ -86,15 +86,15 @@  discard block
 block discarded – undo
86 86
      */
87 87
     public function offsetSet($offset, $value)
88 88
     {
89
-        if(is_array($this->obj)){
89
+        if (is_array($this->obj)) {
90 90
             $this->obj[$offset] = $value;
91
-        }elseif(self::hasProperty($this->obj, $offset)){
91
+        }elseif (self::hasProperty($this->obj, $offset)) {
92 92
             $this->obj->{$offset} = $value;
93
-        }elseif(method_exists($this->obj, 'set')){
93
+        }elseif (method_exists($this->obj, 'set')) {
94 94
             $this->obj->set($offset, $value);
95
-        }elseif(method_exists($this->obj, $method = 'set'.ucfirst($offset))){
95
+        }elseif (method_exists($this->obj, $method = 'set'.ucfirst($offset))) {
96 96
             $this->obj->{$method}($value);
97
-        }else{
97
+        }else {
98 98
             throw new \BadMethodCallException("can not set $offset");
99 99
         }
100 100
     }
@@ -110,35 +110,35 @@  discard block
 block discarded – undo
110 110
      */
111 111
     public function offsetUnset($offset)
112 112
     {
113
-        if(is_array($this->obj)){
113
+        if (is_array($this->obj)) {
114 114
             unset($this->obj[$offset]);
115
-        }elseif(self::hasProperty($this->obj, $offset)){
115
+        }elseif (self::hasProperty($this->obj, $offset)) {
116 116
             unset($this->obj->{$offset});
117
-        }elseif(method_exists($this->obj, 'remove')){
117
+        }elseif (method_exists($this->obj, 'remove')) {
118 118
             $this->obj->remove($offset);
119
-        }elseif(method_exists($this->obj, $method = 'remove'.ucfirst($offset))){
119
+        }elseif (method_exists($this->obj, $method = 'remove'.ucfirst($offset))) {
120 120
             $this->obj->$method();
121
-        }else{
121
+        }else {
122 122
             throw new \InvalidArgumentException("offsetUnset($offset) failed");
123 123
         }
124 124
     }
125
-    static public function strip($obj){
126
-        if($obj instanceof self){
125
+    static public function strip($obj) {
126
+        if ($obj instanceof self) {
127 127
             return $obj->obj;
128 128
         }
129 129
         return $obj;
130 130
     }
131 131
     static function hasProperty($object, $name)
132 132
     {
133
-        if(!is_object($object)){
133
+        if (!is_object($object)) {
134 134
             return false;
135 135
         }
136 136
         $class = new \ReflectionClass($object);
137
-        if(!$class->hasProperty($name)){
137
+        if (!$class->hasProperty($name)) {
138 138
             return false;
139 139
         }
140 140
         $property = $class->getProperty($name);
141
-        if(!$property){
141
+        if (!$property) {
142 142
             return false;
143 143
         }
144 144
         return $property->isPublic();
Please login to merge, or discard this patch.
Braces   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -28,17 +28,17 @@  discard block
 block discarded – undo
28 28
     {
29 29
         if(is_array($this->obj)){
30 30
             return array_key_exists($offset, $this->obj);
31
-        }elseif(self::hasProperty($this->obj, $offset)){
31
+        } elseif(self::hasProperty($this->obj, $offset)){
32 32
             return true;
33
-        }elseif(method_exists($this->obj, 'has')){
33
+        } elseif(method_exists($this->obj, 'has')){
34 34
             return $this->obj->has($offset);
35
-        }elseif(method_exists($this->obj, $method = 'has'.ucfirst($offset))){
35
+        } elseif(method_exists($this->obj, $method = 'has'.ucfirst($offset))){
36 36
             return $this->obj->{$method}($offset);
37
-        }elseif(method_exists($this->obj, $method = 'get'.ucfirst($offset))){
37
+        } elseif(method_exists($this->obj, $method = 'get'.ucfirst($offset))){
38 38
             return $this->obj->{$method}() !== null;
39
-        }elseif(method_exists($this->obj, 'get')){
39
+        } elseif(method_exists($this->obj, 'get')){
40 40
             return $this->obj->get($offset) !== null;
41
-        }else{
41
+        } else{
42 42
             return false;
43 43
         }
44 44
     }
@@ -57,13 +57,13 @@  discard block
 block discarded – undo
57 57
         $res = null;
58 58
         if(is_array($this->obj)){
59 59
             $res = &$this->obj[$offset];
60
-        }elseif(self::hasProperty($this->obj, $offset)){
60
+        } elseif(self::hasProperty($this->obj, $offset)){
61 61
             $res = &$this->obj->{$offset};
62
-        }elseif(method_exists($this->obj, 'get')){
62
+        } elseif(method_exists($this->obj, 'get')){
63 63
             $res = $this->obj->get($offset);
64
-        }elseif(method_exists($this->obj, $method = 'get'.ucfirst($offset))){
64
+        } elseif(method_exists($this->obj, $method = 'get'.ucfirst($offset))){
65 65
             $res = $this->obj->{$method}();
66
-        }else{
66
+        } else{
67 67
             throw new \InvalidArgumentException("offsetGet($offset) failed");
68 68
         }
69 69
         if(is_array($res) || is_object($res)){
@@ -88,13 +88,13 @@  discard block
 block discarded – undo
88 88
     {
89 89
         if(is_array($this->obj)){
90 90
             $this->obj[$offset] = $value;
91
-        }elseif(self::hasProperty($this->obj, $offset)){
91
+        } elseif(self::hasProperty($this->obj, $offset)){
92 92
             $this->obj->{$offset} = $value;
93
-        }elseif(method_exists($this->obj, 'set')){
93
+        } elseif(method_exists($this->obj, 'set')){
94 94
             $this->obj->set($offset, $value);
95
-        }elseif(method_exists($this->obj, $method = 'set'.ucfirst($offset))){
95
+        } elseif(method_exists($this->obj, $method = 'set'.ucfirst($offset))){
96 96
             $this->obj->{$method}($value);
97
-        }else{
97
+        } else{
98 98
             throw new \BadMethodCallException("can not set $offset");
99 99
         }
100 100
     }
@@ -112,13 +112,13 @@  discard block
 block discarded – undo
112 112
     {
113 113
         if(is_array($this->obj)){
114 114
             unset($this->obj[$offset]);
115
-        }elseif(self::hasProperty($this->obj, $offset)){
115
+        } elseif(self::hasProperty($this->obj, $offset)){
116 116
             unset($this->obj->{$offset});
117
-        }elseif(method_exists($this->obj, 'remove')){
117
+        } elseif(method_exists($this->obj, 'remove')){
118 118
             $this->obj->remove($offset);
119
-        }elseif(method_exists($this->obj, $method = 'remove'.ucfirst($offset))){
119
+        } elseif(method_exists($this->obj, $method = 'remove'.ucfirst($offset))){
120 120
             $this->obj->$method();
121
-        }else{
121
+        } else{
122 122
             throw new \InvalidArgumentException("offsetUnset($offset) failed");
123 123
         }
124 124
     }
Please login to merge, or discard this patch.
src/Annotation/ContainerBuilder.php 2 patches
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -41,22 +41,22 @@  discard block
 block discarded – undo
41 41
         //TODO【重要】 使用全局的缓存版本号, 而不是针对每个文件判断缓存过期与否
42 42
         $rfl = new \ReflectionClass($className) or \PhpBoot\abort("load class $className failed");
43 43
         $fileName = $rfl->getFileName();
44
-        $key = str_replace('\\','.',get_class($this)).md5(serialize($this->annotations).$fileName.$className);
44
+        $key = str_replace('\\', '.', get_class($this)).md5(serialize($this->annotations).$fileName.$className);
45 45
         $cache = new CheckableCache($this->cache);
46 46
         $res = $cache->get($key, $this);
47
-        if($res === $this){
48
-            try{
47
+        if ($res === $this) {
48
+            try {
49 49
                 $meta = $this->buildWithoutCache($className);
50
-                $cache->set($key, $meta, 0, $fileName?new ClassModifiedChecker($className):null);
50
+                $cache->set($key, $meta, 0, $fileName ? new ClassModifiedChecker($className) : null);
51 51
                 return $meta;
52
-            }catch (\Exception $e){
52
+            }catch (\Exception $e) {
53 53
                 Logger::warning(__METHOD__.' failed with '.$e->getMessage());
54
-                $cache->set($key, $e->getMessage(), 0, $fileName?new ClassModifiedChecker($className):null);
54
+                $cache->set($key, $e->getMessage(), 0, $fileName ? new ClassModifiedChecker($className) : null);
55 55
                 throw $e;
56 56
             }
57
-        }elseif(is_string($res)){
57
+        }elseif (is_string($res)) {
58 58
             \PhpBoot\abort($res);
59
-        }else{
59
+        }else {
60 60
             return $res;
61 61
         }
62 62
     }
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
     abstract protected function createContainer($className);
69 69
 
70 70
 
71
-    protected function handleAnnotation($handlerName, $container, $ann){
71
+    protected function handleAnnotation($handlerName, $container, $ann) {
72 72
         $handler = new $handlerName();
73 73
         return $handler($container, $ann);
74 74
     }
@@ -80,15 +80,15 @@  discard block
 block discarded – undo
80 80
     {
81 81
         $container = $this->createContainer($className);
82 82
         $anns = AnnotationReader::read($className, $this->cache);
83
-        foreach ($this->annotations as $i){
83
+        foreach ($this->annotations as $i) {
84 84
             list($class, $target) = $i;
85 85
 
86 86
             $found = \JmesPath\search($target, $anns);
87
-            if(is_array($found)){
88
-                foreach ($found as $f){
89
-                    $this->handleAnnotation($class, $container,$f); //TODO 支持
87
+            if (is_array($found)) {
88
+                foreach ($found as $f) {
89
+                    $this->handleAnnotation($class, $container, $f); //TODO 支持
90 90
                 }
91
-            }else{
91
+            }else {
92 92
                 $this->handleAnnotation($class, $container, $found);
93 93
             }
94 94
         }
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
     /**
99 99
      * @var array
100 100
      */
101
-    private $annotations=[];
101
+    private $annotations = [];
102 102
     /**
103 103
      * @var Cache
104 104
      */
Please login to merge, or discard this patch.
Braces   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -49,14 +49,14 @@  discard block
 block discarded – undo
49 49
                 $meta = $this->buildWithoutCache($className);
50 50
                 $cache->set($key, $meta, 0, $fileName?new ClassModifiedChecker($className):null);
51 51
                 return $meta;
52
-            }catch (\Exception $e){
52
+            } catch (\Exception $e){
53 53
                 Logger::warning(__METHOD__.' failed with '.$e->getMessage());
54 54
                 $cache->set($key, $e->getMessage(), 0, $fileName?new ClassModifiedChecker($className):null);
55 55
                 throw $e;
56 56
             }
57
-        }elseif(is_string($res)){
57
+        } elseif(is_string($res)){
58 58
             \PhpBoot\abort($res);
59
-        }else{
59
+        } else{
60 60
             return $res;
61 61
         }
62 62
     }
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
                 foreach ($found as $f){
89 89
                     $this->handleAnnotation($class, $container,$f); //TODO 支持
90 90
                 }
91
-            }else{
91
+            } else{
92 92
                 $this->handleAnnotation($class, $container, $found);
93 93
             }
94 94
         }
Please login to merge, or discard this patch.