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.
Completed
Push — master ( e28ef8...589b37 )
by cao
03:51
created
src/Cache/CheckableCache.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
  */
10 10
 class CheckableCache
11 11
 {
12
-    function __construct(Cache $impl){
12
+    function __construct(Cache $impl) {
13 13
         $this->impl = $impl;
14 14
     }
15 15
    
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
      * @param bool $deleteExpiredData
44 44
      * @return mixed
45 45
      */
46
-    public function get($name, $default = null, &$expiredData=null, $deleteExpiredData=true)
46
+    public function get($name, $default = null, &$expiredData = null, $deleteExpiredData = true)
47 47
     {
48 48
         $expiredData = null;
49 49
         $res = $this->impl->fetch($name);
@@ -52,18 +52,18 @@  discard block
 block discarded – undo
52 52
             // 如果指定了checker, ttl代表每次检查的间隔时间, 0表示每次get都需要经过checker检查
53 53
             // 如果没有指定checker, ttl表示缓存过期时间, 为0表示永不过期
54 54
             if ($checker !== null) {
55
-                if ($ttl == 0 || ($createdTime + $ttl < time())) {
55
+                if ($ttl == 0 || ($createdTime + $ttl<time())) {
56 56
                     $valid = $checker($data, $createdTime);
57
-                    if(!$valid){
57
+                    if (!$valid) {
58 58
                         $expiredData = $data;
59
-                        if($deleteExpiredData){
59
+                        if ($deleteExpiredData) {
60 60
                             $this->impl->delete($name);
61 61
                         }
62 62
                         return $default;
63 63
                     }
64 64
                     
65 65
                 }
66
-            }else if ($ttl != 0 && ($createdTime + $ttl < time())) {
66
+            }else if ($ttl != 0 && ($createdTime + $ttl<time())) {
67 67
                 $this->impl->delete($name);
68 68
                 return $default;
69 69
             }
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
      * 删除
76 76
      * @param string $name
77 77
      */
78
-    public function del($name){
78
+    public function del($name) {
79 79
         return  $this->impl->delete($name);
80 80
     }
81 81
     public function getImpl()
Please login to merge, or discard this patch.
src/Cache/FileModifiedChecker.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -10,25 +10,25 @@  discard block
 block discarded – undo
10 10
     /**
11 11
      * @param string|array $fileName 文件的绝对路径
12 12
      */
13
-    function __construct($fileName){
13
+    function __construct($fileName) {
14 14
         $fileNames = array();
15
-        if(is_string($fileName)){
16
-            $fileNames[]=$fileName;
17
-        }else{
15
+        if (is_string($fileName)) {
16
+            $fileNames[] = $fileName;
17
+        }else {
18 18
             is_array($fileName) or \PhpBoot\abort(new \InvalidArgumentException("string or array is required by param 0"));
19 19
             $fileNames = $fileName;
20 20
         }
21
-        foreach ($fileNames as $fileName){
22
-            if(is_file($fileName)){
21
+        foreach ($fileNames as $fileName) {
22
+            if (is_file($fileName)) {
23 23
                 $this->fileName[$fileName] = @filemtime($fileName);
24 24
             }else {
25 25
                 $this->fileName[$fileName] = @filemtime($fileName);
26
-                if(!is_dir($fileName)){
26
+                if (!is_dir($fileName)) {
27 27
                     continue;
28 28
                 }
29 29
                 $files = @dir($fileName) or \PhpBoot\abort("open dir $fileName failed");
30
-                while (!!($file = $files->read())){
31
-                    if($file == '.' || $file == '..') {
30
+                while (!!($file = $files->read())) {
31
+                    if ($file == '.' || $file == '..') {
32 32
                         continue;
33 33
                     }
34 34
                     $this->fileName[$fileName.'/'.$file] = @filemtime($fileName.'/'.$file);
@@ -43,13 +43,13 @@  discard block
 block discarded – undo
43 43
      * @param int $createdTime
44 44
      * @return boolean
45 45
      */
46
-    public function __invoke($data, $createdTime){
47
-        foreach ($this->fileName as $name => $time){
48
-            if(@filemtime($name) != $time){
46
+    public function __invoke($data, $createdTime) {
47
+        foreach ($this->fileName as $name => $time) {
48
+            if (@filemtime($name) != $time) {
49 49
                 return false;
50 50
             }
51 51
         }
52 52
         return true;
53 53
     }
54
-    private $fileName=[]; //文件全路径
54
+    private $fileName = []; //文件全路径
55 55
 }
Please login to merge, or discard this patch.
src/DB/Context.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
3 3
 /**
4 4
  * @author caoym
5 5
  */
6
-class Context{
6
+class Context {
7 7
 
8 8
     public function __construct($connection)
9 9
     {
@@ -14,13 +14,13 @@  discard block
 block discarded – undo
14 14
      * 拼接sql语句,并自动插入空格
15 15
      * @param string $sql 表达式
16 16
      */
17
-    public function appendSql($sql, $addSpace=true){
18
-        if($this->sql == ''){
17
+    public function appendSql($sql, $addSpace = true) {
18
+        if ($this->sql == '') {
19 19
             $this->sql = $sql;
20
-        }else{
21
-            if($addSpace){
20
+        }else {
21
+            if ($addSpace) {
22 22
                 $this->sql = $this->sql.' '.$sql;
23
-            }else{
23
+            }else {
24 24
                 $this->sql = $this->sql.$sql;
25 25
             }
26 26
         }
@@ -29,15 +29,15 @@  discard block
 block discarded – undo
29 29
      * 增加绑定变量值
30 30
      * @param array $params 变量
31 31
      */
32
-    public function appendParams($params){
32
+    public function appendParams($params) {
33 33
         $this->params = array_merge($this->params, $params);
34 34
     }
35 35
 
36 36
     public function handleResult($result)
37 37
     {
38
-        if($resultHandler = $this->resultHandler){
38
+        if ($resultHandler = $this->resultHandler) {
39 39
             return $resultHandler($result);
40
-        }else{
40
+        }else {
41 41
             return $result;
42 42
         }
43 43
     }
@@ -45,8 +45,8 @@  discard block
 block discarded – undo
45 45
      * @var callable
46 46
      */
47 47
     public $resultHandler;
48
-    public $sql='';
49
-    public $params=[];
48
+    public $sql = '';
49
+    public $params = [];
50 50
     /**
51 51
      * @var \PDO
52 52
      */
Please login to merge, or discard this patch.
src/DB/NestedStringCut.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -7,26 +7,26 @@  discard block
 block discarded – undo
7 7
  * 既从aaa"bb\"b"ccc中, 取出"bb\"b"
8 8
  * @author caoym
9 9
  */
10
-class NestedStringCut{
10
+class NestedStringCut {
11 11
     
12
-    public function __construct($str){
12
+    public function __construct($str) {
13 13
         
14 14
         $pos = 0;
15 15
         $state = 'stateNormal';
16
-        while (true){
16
+        while (true) {
17 17
             $pos = $this->$state($str, $pos, $state);
18
-            if($pos === false){
18
+            if ($pos === false) {
19 19
                 break;
20 20
             }
21 21
         };
22 22
         return false;
23 23
     }
24 24
     
25
-    public function  getSnippets(){
25
+    public function  getSnippets() {
26 26
         return $this->snippets;
27 27
     }
28 28
     
29
-    public function  getText(){
29
+    public function  getText() {
30 30
         return  implode('', $this->snippets);
31 31
     }
32 32
     /**
@@ -34,11 +34,11 @@  discard block
 block discarded – undo
34 34
      * @param int $pos 
35 35
      * @param int
36 36
      */
37
-    public function mapPos($pos){
37
+    public function mapPos($pos) {
38 38
        
39
-        foreach ($this->snippets as $k => $v){
39
+        foreach ($this->snippets as $k => $v) {
40 40
             $pos += $k;
41
-            if($pos < $k + strlen($v)){
41
+            if ($pos<$k + strlen($v)) {
42 42
                 break;
43 43
             }
44 44
             $pos -= ($k + strlen($v));
@@ -49,21 +49,21 @@  discard block
 block discarded – undo
49 49
     /**
50 50
      * 普通状态
51 51
      */
52
-    private function stateNormal($str, $pos, &$next){
52
+    private function stateNormal($str, $pos, &$next) {
53 53
         $ori = $pos;
54 54
         $posSQ = strpos($str, '\'', $pos);
55 55
         $posDQ = strpos($str, '"', $pos);
56 56
         $pos = $posSQ;
57 57
         $this->subStateQ = '\'';
58 58
         $next = 'stateQ';
59
-        if($posDQ !== false && (($posDQ < $pos) || ($pos === false)) ){
59
+        if ($posDQ !== false && (($posDQ<$pos) || ($pos === false))) {
60 60
             $pos = $posDQ;
61 61
             $this->subStateQ = '"';
62 62
         }
63
-        if($pos !== false){
64
-            $this->snippets[$ori] = substr($str, $ori, $pos-$ori);
65
-            $pos ++;
66
-        }else{
63
+        if ($pos !== false) {
64
+            $this->snippets[$ori] = substr($str, $ori, $pos - $ori);
65
+            $pos++;
66
+        }else {
67 67
             $this->snippets[$ori] = substr($str, $ori);
68 68
         }
69 69
         return $pos;
@@ -72,27 +72,27 @@  discard block
 block discarded – undo
72 72
     /**
73 73
      * 进入引号状态
74 74
      */
75
-    private function stateQ($str, $pos, &$next){
75
+    private function stateQ($str, $pos, &$next) {
76 76
         $posESC = strpos($str, '\\', $pos);
77 77
         $posQ = strpos($str, $this->subStateQ, $pos);
78 78
         $pos = $posESC;
79 79
         $next = 'stateESC';
80 80
         
81
-        if($posQ !== false && (($posQ<$posESC) || ($posESC === false))){
81
+        if ($posQ !== false && (($posQ<$posESC) || ($posESC === false))) {
82 82
             $pos = $posQ;
83 83
             $next = 'stateNormal';
84 84
         }
85
-        if($pos !== false){
86
-            $pos ++;
85
+        if ($pos !== false) {
86
+            $pos++;
87 87
         }
88 88
         return $pos;
89 89
     }
90 90
     /**
91 91
      * 进入转义状态
92 92
      */
93
-    private function stateESC($str, $pos, &$next){
93
+    private function stateESC($str, $pos, &$next) {
94 94
         $pos++;
95
-        if($pos >= strlen($str)){
95
+        if ($pos>=strlen($str)) {
96 96
             return false;
97 97
         }
98 98
         $next = 'stateQ';
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
      * 去掉嵌套字符串后的内容
103 103
      * @var array
104 104
      */
105
-    private $snippets=array();
105
+    private $snippets = array();
106 106
     
107 107
     private $subStateQ;
108 108
 }
Please login to merge, or discard this patch.
src/DB/Rows.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -2,30 +2,30 @@
 block discarded – undo
2 2
 
3 3
 namespace PhpBoot\DB;
4 4
 
5
-if(!function_exists("array_column"))
5
+if (!function_exists("array_column"))
6 6
 {
7 7
 
8 8
     function array_column($array, $column_name)
9 9
     {
10 10
 
11
-        return array_map(function($element) use($column_name){return $element[$column_name];}, $array);
11
+        return array_map(function($element) use($column_name){return $element[$column_name]; }, $array);
12 12
 
13 13
     }
14 14
 
15 15
 }
16 16
 class Rows
17 17
 {
18
-    static function column($array,$column_name)
18
+    static function column($array, $column_name)
19 19
     {
20 20
 
21
-        return array_map(function($element) use($column_name){return $element[$column_name];}, $array);
21
+        return array_map(function($element) use($column_name){return $element[$column_name]; }, $array);
22 22
 
23 23
     }
24
-    static public function leftJoin(&$lh, $rh, $lKey, $rkey, $destKey){
25
-        $map = array_combine(self::column($rh,$rkey),$rh);
24
+    static public function leftJoin(&$lh, $rh, $lKey, $rkey, $destKey) {
25
+        $map = array_combine(self::column($rh, $rkey), $rh);
26 26
 
27
-        foreach ($lh as &$v){
28
-            $v[$destKey]=$map[$v[$lKey]];
27
+        foreach ($lh as &$v) {
28
+            $v[$destKey] = $map[$v[$lKey]];
29 29
         }
30 30
     }
31 31
 }
32 32
\ No newline at end of file
Please login to merge, or discard this patch.
src/DB/Raw.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,10 +13,10 @@
 block discarded – undo
13 13
     function __construct($str) {
14 14
         $this->str = $str;
15 15
     }
16
-    public function __toString(){
16
+    public function __toString() {
17 17
         return $this->str;
18 18
     }
19
-    public function get(){
19
+    public function get() {
20 20
         return $this->str;
21 21
     }
22 22
     private $str;
Please login to merge, or discard this patch.
src/RPC/MultiRequest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
         return $request->getResults();
21 21
     }
22 22
 
23
-    public static function isRunning(){
23
+    public static function isRunning() {
24 24
         return !!self::$currentContext;
25 25
     }
26 26
 
Please login to merge, or discard this patch.
src/RPC/MultiRpc.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -21,12 +21,12 @@  discard block
 block discarded – undo
21 21
          * ]
22 22
          *
23 23
          */
24
-        return MultiRequest::run($threads, function($promises){
24
+        return MultiRequest::run($threads, function($promises) {
25 25
             $res = [];
26
-            foreach (Promise\settle($promises)->wait() as $i){
27
-                if(isset($i['reason'])){
26
+            foreach (Promise\settle($promises)->wait() as $i) {
27
+                if (isset($i['reason'])) {
28 28
                     $res[] = [null, new RpcException($i['reason'])];
29
-                }else{
29
+                }else {
30 30
                     $res[] = [$i['value'], null];
31 31
                 }
32 32
             }
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
         });
35 35
     }
36 36
 
37
-    public static function isRunning(){
37
+    public static function isRunning() {
38 38
         return MultiRequest::isRunning();
39 39
     }
40 40
 
Please login to merge, or discard this patch.
src/Annotation/AnnotationReader.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -45,9 +45,9 @@  discard block
 block discarded – undo
45 45
 }
46 46
 class AnnotationReader implements \ArrayAccess
47 47
 {
48
-    static public function createDocBlockFactory(){
48
+    static public function createDocBlockFactory() {
49 49
         $fqsenResolver = new FqsenResolver();
50
-        $tagFactory = new StandardTagFactory($fqsenResolver,[]);
50
+        $tagFactory = new StandardTagFactory($fqsenResolver, []);
51 51
         $descriptionFactory = new DescriptionFactory($tagFactory);
52 52
         $tagFactory->addService($descriptionFactory);
53 53
         $tagFactory->addService(new TypeResolver($fqsenResolver));
@@ -72,22 +72,22 @@  discard block
 block discarded – undo
72 72
         self::assertAnnotationEnabled();
73 73
         $rfl = new \ReflectionClass($className) or \PhpBoot\abort("load class $className failed");
74 74
         $fileName = $rfl->getFileName();
75
-        $key = str_replace('\\','.',self::class).md5($fileName.$className);
75
+        $key = str_replace('\\', '.', self::class).md5($fileName.$className);
76 76
         $oldData = null;
77
-        $cache = new CheckableCache($localCache?:new ApcCache());
77
+        $cache = new CheckableCache($localCache ?: new ApcCache());
78 78
         $res = $cache->get('ann:'.$key, null, $oldData, false);
79
-        if($res === null){
80
-            try{
79
+        if ($res === null) {
80
+            try {
81 81
                 $meta = self::readWithoutCache($className);
82
-                $cache->set($key, $meta, 0, $fileName?new ClassModifiedChecker($className):null);
82
+                $cache->set($key, $meta, 0, $fileName ? new ClassModifiedChecker($className) : null);
83 83
                 return $meta;
84
-            }catch (\Exception $e){
85
-                $cache->set($key, $e->getMessage(), 0, $fileName?new ClassModifiedChecker($className):null);
84
+            }catch (\Exception $e) {
85
+                $cache->set($key, $e->getMessage(), 0, $fileName ? new ClassModifiedChecker($className) : null);
86 86
                 throw $e;
87 87
             }
88
-        }elseif(is_string($res)){
88
+        }elseif (is_string($res)) {
89 89
             \PhpBoot\abort($res);
90
-        }else{
90
+        }else {
91 91
             return $res;
92 92
         }
93 93
     }
@@ -104,19 +104,19 @@  discard block
 block discarded – undo
104 104
         $reader->class->name = $className;
105 105
 
106 106
         //method annotations
107
-        foreach ($rfl->getMethods() as $i){
107
+        foreach ($rfl->getMethods() as $i) {
108 108
             $block = self::readAnnotationBlock($i->getDocComment());
109 109
             $block->name = $i->getName();
110
-            $reader->methods[$i->getName()]=$block;
110
+            $reader->methods[$i->getName()] = $block;
111 111
         }
112 112
         //property annotations
113
-        foreach ($rfl->getProperties() as $i){
113
+        foreach ($rfl->getProperties() as $i) {
114 114
             if ($i->isStatic()) {
115 115
                 continue;
116 116
             }
117 117
             $block = self::readAnnotationBlock($i->getDocComment());
118 118
             $block->name = $i->getName();
119
-            $reader->properties[$i->getName()]=$block;
119
+            $reader->properties[$i->getName()] = $block;
120 120
         }
121 121
         while ($rfl = $rfl->getParentClass()) {
122 122
             foreach ($rfl->getProperties(\ReflectionProperty::IS_PRIVATE) as $i) {
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
                 }
126 126
                 $block = self::readAnnotationBlock($i->getDocComment());
127 127
                 $block->name = $i->getName();
128
-                $reader->properties[$i->getName()]=$block;
128
+                $reader->properties[$i->getName()] = $block;
129 129
             }
130 130
         }
131 131
         return $reader;
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
     static private function readAnnotationBlock($doc)
135 135
     {
136 136
         $annBlock = new AnnotationBlock();
137
-        if(empty($doc)){
137
+        if (empty($doc)) {
138 138
             return $annBlock;
139 139
         }
140 140
         $docFactory = AnnotationReader::createDocBlockFactory();
@@ -149,8 +149,8 @@  discard block
 block discarded – undo
149 149
             $annTag->parent = $annBlock;
150 150
             $annTag->description = strval($desc);
151 151
             $annTag->name = $tag->getName();
152
-            $annTag->children=[];
153
-            if($desc){
152
+            $annTag->children = [];
153
+            if ($desc) {
154 154
                 $output = new AnnotationTagsOutput();
155 155
                 $desc->render($output);
156 156
                 foreach ($output->tags as $child) {
@@ -174,11 +174,11 @@  discard block
 block discarded – undo
174 174
      * @var AnnotationBlock[]
175 175
      */
176 176
 
177
-    public $methods=[];
177
+    public $methods = [];
178 178
     /**
179 179
      * @var AnnotationBlock[]
180 180
      */
181
-    public $properties=[];
181
+    public $properties = [];
182 182
 
183 183
     public function offsetExists($offset)
184 184
     {
Please login to merge, or discard this patch.