@@ -18,11 +18,11 @@ discard block |
||
| 18 | 18 | |
| 19 | 19 | public function login($all_data) |
| 20 | 20 | { |
| 21 | - if(isset($all_data["url"])) $url = $all_data["url"]; else throw new Exception("url is not exist in all_data"); |
|
| 22 | - if(isset($all_data["data"])) $data = $all_data["data"]; else throw new Exception("data is not exist in all_data"); |
|
| 23 | - if(isset($all_data["oj"])) $oj = $all_data["oj"]; else throw new Exception("oj is not exist in all_data"); |
|
| 24 | - if(isset($all_data["ret"])) $ret = $all_data["ret"]; else $ret = 'false'; |
|
| 25 | - if(isset($all_data["handle"])) $handle = $all_data["handle"]; else $handle = "default"; |
|
| 21 | + if (isset($all_data["url"])) $url=$all_data["url"]; else throw new Exception("url is not exist in all_data"); |
|
| 22 | + if (isset($all_data["data"])) $data=$all_data["data"]; else throw new Exception("data is not exist in all_data"); |
|
| 23 | + if (isset($all_data["oj"])) $oj=$all_data["oj"]; else throw new Exception("oj is not exist in all_data"); |
|
| 24 | + if (isset($all_data["ret"])) $ret=$all_data["ret"]; else $ret='false'; |
|
| 25 | + if (isset($all_data["handle"])) $handle=$all_data["handle"]; else $handle="default"; |
|
| 26 | 26 | |
| 27 | 27 | $datapost=curl_init(); |
| 28 | 28 | $headers=array("Expect:"); |
@@ -54,11 +54,11 @@ discard block |
||
| 54 | 54 | |
| 55 | 55 | public function grab_page($all_data) |
| 56 | 56 | { |
| 57 | - if(isset($all_data["site"])) $site = $all_data["site"]; else throw new Exception("site is not exist in all_data"); |
|
| 58 | - if(isset($all_data["oj"])) $oj = $all_data["oj"]; else throw new Exception("oj is not exist in all_data"); |
|
| 59 | - if(isset($all_data["headers"])) $headers = $all_data["headers"]; else $headers = []; |
|
| 60 | - if(isset($all_data["handle"])) $handle = $all_data["handle"]; else $handle = "default"; |
|
| 61 | - if(isset($all_data["follow"])) $follow = $all_data["follow"]; else $handle = false; |
|
| 57 | + if (isset($all_data["site"])) $site=$all_data["site"]; else throw new Exception("site is not exist in all_data"); |
|
| 58 | + if (isset($all_data["oj"])) $oj=$all_data["oj"]; else throw new Exception("oj is not exist in all_data"); |
|
| 59 | + if (isset($all_data["headers"])) $headers=$all_data["headers"]; else $headers=[]; |
|
| 60 | + if (isset($all_data["handle"])) $handle=$all_data["handle"]; else $handle="default"; |
|
| 61 | + if (isset($all_data["follow"])) $follow=$all_data["follow"]; else $handle=false; |
|
| 62 | 62 | |
| 63 | 63 | $handle=urlencode($handle); |
| 64 | 64 | |
@@ -85,15 +85,15 @@ discard block |
||
| 85 | 85 | |
| 86 | 86 | public function post_data($all_data) |
| 87 | 87 | { |
| 88 | - if(isset($all_data["site"])) $site = $all_data["site"]; else throw new Exception("site is not exist in all_data"); |
|
| 89 | - if(isset($all_data["data"])) $data = $all_data["data"]; else throw new Exception("data is not exist in all_data"); |
|
| 90 | - if(isset($all_data["oj"])) $oj = $all_data["oj"]; else throw new Exception("oj is not exist in all_data"); |
|
| 91 | - if(isset($all_data["ret"])) $ret = $all_data["ret"]; else $ret = false; |
|
| 92 | - if(isset($all_data["follow"])) $follow = $all_data["follow"]; else $follow = true; |
|
| 93 | - if(isset($all_data["returnHeader"])) $returnHeader = $all_data["returnHeader"]; else $returnHeader = true; |
|
| 94 | - if(isset($all_data["postJson"])) $postJson = $all_data["postJson"]; else $postJson = false; |
|
| 95 | - if(isset($all_data["extraHeaders"])) $extraHeaders = $all_data["extraHeaders"]; else $extraHeaders = []; |
|
| 96 | - if(isset($all_data["handle"])) $handle = $all_data["handle"]; else $handle = "default"; |
|
| 88 | + if (isset($all_data["site"])) $site=$all_data["site"]; else throw new Exception("site is not exist in all_data"); |
|
| 89 | + if (isset($all_data["data"])) $data=$all_data["data"]; else throw new Exception("data is not exist in all_data"); |
|
| 90 | + if (isset($all_data["oj"])) $oj=$all_data["oj"]; else throw new Exception("oj is not exist in all_data"); |
|
| 91 | + if (isset($all_data["ret"])) $ret=$all_data["ret"]; else $ret=false; |
|
| 92 | + if (isset($all_data["follow"])) $follow=$all_data["follow"]; else $follow=true; |
|
| 93 | + if (isset($all_data["returnHeader"])) $returnHeader=$all_data["returnHeader"]; else $returnHeader=true; |
|
| 94 | + if (isset($all_data["postJson"])) $postJson=$all_data["postJson"]; else $postJson=false; |
|
| 95 | + if (isset($all_data["extraHeaders"])) $extraHeaders=$all_data["extraHeaders"]; else $extraHeaders=[]; |
|
| 96 | + if (isset($all_data["handle"])) $handle=$all_data["handle"]; else $handle="default"; |
|
| 97 | 97 | |
| 98 | 98 | $handle=urlencode($handle); |
| 99 | 99 | |
@@ -51,7 +51,7 @@ |
||
| 51 | 51 | } catch (ErrorException $e) { |
| 52 | 52 | } catch (Exception $e) { |
| 53 | 53 | } |
| 54 | - $className = "App\\Babel\\Extension\\$oj\\$submitterProvider"; |
|
| 54 | + $className="App\\Babel\\Extension\\$oj\\$submitterProvider"; |
|
| 55 | 55 | if (class_exists($className)) { |
| 56 | 56 | return new $className($sub, $all_data); |
| 57 | 57 | } else { |
@@ -56,7 +56,7 @@ |
||
| 56 | 56 | } catch (ErrorException $e) { |
| 57 | 57 | } catch (Exception $e) { |
| 58 | 58 | } |
| 59 | - $className = "App\\Babel\\Extension\\$name\\$judgerProvider"; |
|
| 59 | + $className="App\\Babel\\Extension\\$name\\$judgerProvider"; |
|
| 60 | 60 | if (class_exists($className)) { |
| 61 | 61 | return new $className(); |
| 62 | 62 | } else { |
@@ -38,8 +38,8 @@ discard block |
||
| 38 | 38 | //writing database |
| 39 | 39 | $this->transactionDB(); |
| 40 | 40 | |
| 41 | - }catch(Throwable $e){ |
|
| 42 | - if ($e->getMessage()!==""){ |
|
| 41 | + } catch (Throwable $e) { |
|
| 42 | + if ($e->getMessage()!=="") { |
|
| 43 | 43 | $this->command->line("\n <bg=red;fg=white> {$e->getMessage()} </>\n"); |
| 44 | 44 | } |
| 45 | 45 | } |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | public function __construct($class) |
| 59 | 59 | { |
| 60 | 60 | $this->command=$class; |
| 61 | - $this->versionParser = new VersionConstraintParser(); |
|
| 61 | + $this->versionParser=new VersionConstraintParser(); |
|
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | |
@@ -136,8 +136,8 @@ discard block |
||
| 136 | 136 | private function delFile($dirName) |
| 137 | 137 | { |
| 138 | 138 | if (file_exists($dirName) && $handle=opendir($dirName)) { |
| 139 | - while (false!==($item = readdir($handle))) { |
|
| 140 | - if ($item!= "." && $item != "..") { |
|
| 139 | + while (false!==($item=readdir($handle))) { |
|
| 140 | + if ($item!="." && $item!="..") { |
|
| 141 | 141 | if (file_exists($dirName.'/'.$item) && is_dir($dirName.'/'.$item)) { |
| 142 | 142 | delFile($dirName.'/'.$item); |
| 143 | 143 | } else { |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | |
| 154 | 154 | private function parseVersion() |
| 155 | 155 | { |
| 156 | - if(empty($this->babelConfig)){ |
|
| 156 | + if (empty($this->babelConfig)) { |
|
| 157 | 157 | throw new Exception('Missing babel.json Config file.'); |
| 158 | 158 | } |
| 159 | 159 | |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | |
| 221 | 221 | DB::commit(); |
| 222 | 222 | |
| 223 | - }catch(Throwable $e){ |
|
| 223 | + } catch (Throwable $e) { |
|
| 224 | 224 | DB::rollback(); |
| 225 | 225 | if ($e->getMessage()!=="") { |
| 226 | 226 | $this->command->line("\n <bg=red;fg=white> {$e->getMessage()} </>\n"); |
@@ -308,9 +308,9 @@ discard block |
||
| 308 | 308 | $installed_timestamp=intval($info["compiler_timestamp"]); |
| 309 | 309 | } |
| 310 | 310 | $latest_timestamp=$installed_timestamp; |
| 311 | - $ConpilerConfig = glob(babel_path("Extension/$ocode/compiler/*.*")); |
|
| 311 | + $ConpilerConfig=glob(babel_path("Extension/$ocode/compiler/*.*")); |
|
| 312 | 312 | foreach ($ConpilerConfig as $file) { |
| 313 | - if (intval(basename($file)) > $installed_timestamp) { |
|
| 313 | + if (intval(basename($file))>$installed_timestamp) { |
|
| 314 | 314 | try { |
| 315 | 315 | $this->commitCompiler($file, json_decode(file_get_contents($file), true)); |
| 316 | 316 | $latest_timestamp=intval(basename($file)); |
@@ -88,11 +88,11 @@ discard block |
||
| 88 | 88 | if (!isset($data["ori"]) || !isset($data["path"]) || !isset($data["baseurl"]) || !isset($data["space_deli"]) || !isset($data["cookie"])) { |
| 89 | 89 | throw new Exception("data is not completely exist in cacheImage"); |
| 90 | 90 | } |
| 91 | - $ori = $data["ori"]; |
|
| 92 | - $path = $data["path"]; |
|
| 93 | - $baseurl = $data["baseurl"]; |
|
| 94 | - $space_deli = $data["space_deli"]; |
|
| 95 | - $cookie = $data["cookie"]; |
|
| 91 | + $ori=$data["ori"]; |
|
| 92 | + $path=$data["path"]; |
|
| 93 | + $baseurl=$data["baseurl"]; |
|
| 94 | + $space_deli=$data["space_deli"]; |
|
| 95 | + $cookie=$data["cookie"]; |
|
| 96 | 96 | |
| 97 | 97 | $para["path"]=$path; |
| 98 | 98 | $para["base"]=$baseurl; |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | $reg="/< *im[a]?g[^>]*src *= *[\"\\']?([^\"\\'>]*)[^>]*>/si"; |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | - return preg_replace_callback($reg, function ($matches) use ($para) { |
|
| 108 | + return preg_replace_callback($reg, function($matches) use ($para) { |
|
| 109 | 109 | global $config; |
| 110 | 110 | $url=trim($matches[1]); |
| 111 | 111 | if (stripos($url, "http://")===false && stripos($url, "https://")===false) { |
@@ -138,24 +138,24 @@ discard block |
||
| 138 | 138 | public function procInfo($data) |
| 139 | 139 | { |
| 140 | 140 | if (isset($data["path"])) { |
| 141 | - $path = $data["path"]; |
|
| 141 | + $path=$data["path"]; |
|
| 142 | 142 | } else { |
| 143 | 143 | throw new Exception("path is not exist in data"); |
| 144 | 144 | } |
| 145 | 145 | if (isset($data["baseurl"])) { |
| 146 | - $baseurl = $data["baseurl"]; |
|
| 146 | + $baseurl=$data["baseurl"]; |
|
| 147 | 147 | } else { |
| 148 | 148 | throw new Exception("baseurl is not exist in data"); |
| 149 | 149 | } |
| 150 | 150 | if (isset($data["space_deli"])) { |
| 151 | - $space_deli = $data["space_deli"]; |
|
| 151 | + $space_deli=$data["space_deli"]; |
|
| 152 | 152 | } else { |
| 153 | - $space_deli = true; |
|
| 153 | + $space_deli=true; |
|
| 154 | 154 | } |
| 155 | 155 | if (isset($data["cookie"])) { |
| 156 | - $cookie = $data["cookie"]; |
|
| 156 | + $cookie=$data["cookie"]; |
|
| 157 | 157 | } else { |
| 158 | - $cookie = ""; |
|
| 158 | + $cookie=""; |
|
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | $this->pro["description"]=$this->_cacheImage($this->pro["description"], $path, $baseurl, $space_deli, $cookie); |
@@ -32,7 +32,7 @@ |
||
| 32 | 32 | } catch (ErrorException $e) { |
| 33 | 33 | } catch (Exception $e) { |
| 34 | 34 | } |
| 35 | - $className = "App\\Babel\\Extension\\$name\\$crawlerProvider"; |
|
| 35 | + $className="App\\Babel\\Extension\\$name\\$crawlerProvider"; |
|
| 36 | 36 | if (class_exists($className)) { |
| 37 | 37 | $temp=new $className(); |
| 38 | 38 | $temp->importCommandLine($commandLineObject); |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | } catch (ErrorException $e) { |
| 34 | 34 | } catch (Exception $e) { |
| 35 | 35 | } |
| 36 | - $className = "App\\Babel\\Extension\\$name\\$monitorProvider"; |
|
| 36 | + $className="App\\Babel\\Extension\\$name\\$monitorProvider"; |
|
| 37 | 37 | if (class_exists($className)) { |
| 38 | 38 | return new $className(); |
| 39 | 39 | } else { |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | if (!function_exists('emailVerified')) { |
| 54 | 54 | function emailVerified() |
| 55 | 55 | { |
| 56 | - if(Auth::check()){ |
|
| 56 | + if (Auth::check()) { |
|
| 57 | 57 | return !is_null(Auth::user()->email_verified_at); |
| 58 | 58 | } |
| 59 | 59 | |
@@ -61,20 +61,20 @@ discard block |
||
| 61 | 61 | } |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | -if (! function_exists('babel_path')) { |
|
| 64 | +if (!function_exists('babel_path')) { |
|
| 65 | 65 | /** |
| 66 | 66 | * Get the path to the application folder. |
| 67 | 67 | * |
| 68 | 68 | * @param string $path |
| 69 | 69 | * @return string |
| 70 | 70 | */ |
| 71 | - function babel_path($path = '') |
|
| 71 | + function babel_path($path='') |
|
| 72 | 72 | { |
| 73 | 73 | return app('path').DIRECTORY_SEPARATOR.'Babel'.($path ? DIRECTORY_SEPARATOR.$path : $path); |
| 74 | 74 | } |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | -if (! function_exists('glob_recursive')) { |
|
| 77 | +if (!function_exists('glob_recursive')) { |
|
| 78 | 78 | /** |
| 79 | 79 | * Find pathnames matching a pattern recursively. |
| 80 | 80 | * |
@@ -82,11 +82,11 @@ discard block |
||
| 82 | 82 | * @param int $flags Valid flags: GLOB_MARK |
| 83 | 83 | * @return array|false an array containing the matched files/directories, an empty array if no file matched or false on error. |
| 84 | 84 | */ |
| 85 | - function glob_recursive($pattern, $flags = 0) |
|
| 85 | + function glob_recursive($pattern, $flags=0) |
|
| 86 | 86 | { |
| 87 | - $files = glob($pattern, $flags); |
|
| 88 | - foreach (glob(dirname($pattern).'/*', GLOB_ONLYDIR|GLOB_NOSORT) as $dir) { |
|
| 89 | - $files = array_merge($files, glob_recursive($dir.'/'.basename($pattern), $flags)); |
|
| 87 | + $files=glob($pattern, $flags); |
|
| 88 | + foreach (glob(dirname($pattern).'/*', GLOB_ONLYDIR | GLOB_NOSORT) as $dir) { |
|
| 89 | + $files=array_merge($files, glob_recursive($dir.'/'.basename($pattern), $flags)); |
|
| 90 | 90 | } |
| 91 | 91 | return $files; |
| 92 | 92 | } |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | if (!function_exists('adminMenu')) { |
| 96 | 96 | function adminMenu() |
| 97 | 97 | { |
| 98 | - return json_decode(file_get_contents(app_path('Admin/menu.json')),true); |
|
| 98 | + return json_decode(file_get_contents(app_path('Admin/menu.json')), true); |
|
| 99 | 99 | } |
| 100 | 100 | } |
| 101 | 101 | |
@@ -16,16 +16,16 @@ discard block |
||
| 16 | 16 | private $member_data; |
| 17 | 17 | private $config; |
| 18 | 18 | |
| 19 | - public function __construct($data, $config = []) |
|
| 19 | + public function __construct($data, $config=[]) |
|
| 20 | 20 | { |
| 21 | - if ($config['mode'] == 'contest') { |
|
| 22 | - $this->contest_data = $data['contest_data']; |
|
| 23 | - $this->member_data = $data['member_data']; |
|
| 21 | + if ($config['mode']=='contest') { |
|
| 22 | + $this->contest_data=$data['contest_data']; |
|
| 23 | + $this->member_data=$data['member_data']; |
|
| 24 | 24 | } else { |
| 25 | - $this->member_data = $data['member_data']; |
|
| 26 | - $this->tag_problems = $data['tag_problems']; |
|
| 25 | + $this->member_data=$data['member_data']; |
|
| 26 | + $this->tag_problems=$data['tag_problems']; |
|
| 27 | 27 | } |
| 28 | - $this->config = $config; |
|
| 28 | + $this->config=$config; |
|
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | /** |
@@ -34,9 +34,9 @@ discard block |
||
| 34 | 34 | public function registerEvents(): array |
| 35 | 35 | { |
| 36 | 36 | return [ |
| 37 | - AfterSheet::class => function (AfterSheet $event) { |
|
| 38 | - if ($this->config['mode'] === 'contest') { |
|
| 39 | - $mergeCell = ['A1:A2','B1:E1']; |
|
| 37 | + AfterSheet::class => function(AfterSheet $event) { |
|
| 38 | + if ($this->config['mode']==='contest') { |
|
| 39 | + $mergeCell=['A1:A2', 'B1:E1']; |
|
| 40 | 40 | foreach ($this->contest_data as $c) { |
| 41 | 41 | array_push($mergeCell, $this->mergeCellColumnNext()); |
| 42 | 42 | } |
@@ -51,44 +51,44 @@ discard block |
||
| 51 | 51 | */ |
| 52 | 52 | public function collection() |
| 53 | 53 | { |
| 54 | - $maxium = $this->config['maxium'] ?? false; |
|
| 55 | - $percent = $this->config['percent'] ?? false; |
|
| 54 | + $maxium=$this->config['maxium'] ?? false; |
|
| 55 | + $percent=$this->config['percent'] ?? false; |
|
| 56 | 56 | |
| 57 | - if ($this->config['mode'] == 'contest') { |
|
| 58 | - $row_1 = ['Member','Total','','','']; |
|
| 59 | - $row_2 = ['','Elo','Rank','Solved','Penalty']; |
|
| 57 | + if ($this->config['mode']=='contest') { |
|
| 58 | + $row_1=['Member', 'Total', '', '', '']; |
|
| 59 | + $row_2=['', 'Elo', 'Rank', 'Solved', 'Penalty']; |
|
| 60 | 60 | foreach ($this->contest_data as $contest) { |
| 61 | 61 | array_push($row_1, $contest['name'], ''); |
| 62 | 62 | array_push($row_2, 'Solved', 'Penalty'); |
| 63 | 63 | } |
| 64 | - $data = [$row_1,$row_2]; |
|
| 64 | + $data=[$row_1, $row_2]; |
|
| 65 | 65 | foreach ($this->member_data as $member) { |
| 66 | - $display_name = $member['name']; |
|
| 66 | + $display_name=$member['name']; |
|
| 67 | 67 | if (!empty($member['nick_name'])) { |
| 68 | - $display_name .= ' ('.$member['nick_name'].')'; |
|
| 68 | + $display_name.=' ('.$member['nick_name'].')'; |
|
| 69 | 69 | } |
| 70 | - $row = [ |
|
| 70 | + $row=[ |
|
| 71 | 71 | $display_name, |
| 72 | 72 | $member['elo'], |
| 73 | 73 | !empty($member['rank_ave']) ? round($member['rank_ave'], 1) : '-', |
| 74 | - $percent === 'true' ? ($member['problem_all'] != 0 ? round($member['solved_all'] / $member['problem_all'] * 100, 1) : '-'). ' %' |
|
| 75 | - : ($maxium === 'true' ? $member['solved_all'] . ' / ' . $member['problem_all'] : $member['solved_all']), |
|
| 74 | + $percent==='true' ? ($member['problem_all']!=0 ? round($member['solved_all'] / $member['problem_all'] * 100, 1) : '-').' %' |
|
| 75 | + : ($maxium==='true' ? $member['solved_all'].' / '.$member['problem_all'] : $member['solved_all']), |
|
| 76 | 76 | round($member['penalty']), |
| 77 | 77 | ]; |
| 78 | 78 | foreach ($this->contest_data as $contest) { |
| 79 | 79 | if (in_array($contest['cid'], array_keys($member['contest_detial']))) { |
| 80 | - $contest_detial = $member['contest_detial'][$contest['cid']]; |
|
| 80 | + $contest_detial=$member['contest_detial'][$contest['cid']]; |
|
| 81 | 81 | array_push( |
| 82 | 82 | $row, |
| 83 | - $percent === 'true' ? (round($contest_detial['solved'] / $contest_detial['problems'] * 100, 1) . ' %') |
|
| 84 | - : ($maxium === 'true' ? $contest_detial['solved'].' / '.$contest_detial['problems'] : $contest_detial['solved']), |
|
| 83 | + $percent==='true' ? (round($contest_detial['solved'] / $contest_detial['problems'] * 100, 1).' %') |
|
| 84 | + : ($maxium==='true' ? $contest_detial['solved'].' / '.$contest_detial['problems'] : $contest_detial['solved']), |
|
| 85 | 85 | round($contest_detial['penalty']) |
| 86 | 86 | ); |
| 87 | 87 | } else { |
| 88 | 88 | array_push( |
| 89 | 89 | $row, |
| 90 | - $percent === 'true' ? '- %' |
|
| 91 | - : ($maxium === 'true' ? '- / -' : ' - '), |
|
| 90 | + $percent==='true' ? '- %' |
|
| 91 | + : ($maxium==='true' ? '- / -' : ' - '), |
|
| 92 | 92 | 0 |
| 93 | 93 | ); |
| 94 | 94 | } |
@@ -96,27 +96,27 @@ discard block |
||
| 96 | 96 | array_push($data, $row); |
| 97 | 97 | } |
| 98 | 98 | } else { |
| 99 | - $row_1 = ['Member']; |
|
| 100 | - $row_2 = ['']; |
|
| 99 | + $row_1=['Member']; |
|
| 100 | + $row_2=['']; |
|
| 101 | 101 | foreach ($this->tag_problems as $tag => $tag_problem_set) { |
| 102 | 102 | array_push($row_1, $tag); |
| 103 | 103 | array_push($row_2, 'Solved'); |
| 104 | 104 | } |
| 105 | - $data = [$row_1,$row_2]; |
|
| 105 | + $data=[$row_1, $row_2]; |
|
| 106 | 106 | foreach ($this->member_data as $member) { |
| 107 | - $display_name = $member['name']; |
|
| 107 | + $display_name=$member['name']; |
|
| 108 | 108 | if (!empty($member['nick_name'])) { |
| 109 | - $display_name .= ' ('.$member['nick_name'].')'; |
|
| 109 | + $display_name.=' ('.$member['nick_name'].')'; |
|
| 110 | 110 | } |
| 111 | - $row = [ |
|
| 111 | + $row=[ |
|
| 112 | 112 | $display_name, |
| 113 | 113 | ]; |
| 114 | 114 | foreach ($member['completion'] as $tag => $tag_completion) { |
| 115 | - $count = count($tag_completion); |
|
| 116 | - $solved = eval('return '.join('+', array_values($tag_completion)).';'); |
|
| 115 | + $count=count($tag_completion); |
|
| 116 | + $solved=eval('return '.join('+', array_values($tag_completion)).';'); |
|
| 117 | 117 | array_push( |
| 118 | 118 | $row, |
| 119 | - $percent === 'true' ? (round($solved / $count * 100, 1) . ' %') : ($maxium === 'true' ? $solved .' / '.$count : $solved) |
|
| 119 | + $percent==='true' ? (round($solved / $count * 100, 1).' %') : ($maxium==='true' ? $solved.' / '.$count : $solved) |
|
| 120 | 120 | ); |
| 121 | 121 | } |
| 122 | 122 | array_push($data, $row); |
@@ -127,33 +127,33 @@ discard block |
||
| 127 | 127 | |
| 128 | 128 | private function mergeCellColumnNext() |
| 129 | 129 | { |
| 130 | - static $columns = [ |
|
| 131 | - [3],[4] |
|
| 130 | + static $columns=[ |
|
| 131 | + [3], [4] |
|
| 132 | 132 | ]; |
| 133 | - $columns_str = ['','']; |
|
| 134 | - $chars = str_split('ABCDEFGHIJKLMNOPQRSTUVWXYZ'); |
|
| 133 | + $columns_str=['', '']; |
|
| 134 | + $chars=str_split('ABCDEFGHIJKLMNOPQRSTUVWXYZ'); |
|
| 135 | 135 | foreach ($columns as $key => &$column) { |
| 136 | - $column[0] += 2; |
|
| 137 | - if ($column[0] > 25) { |
|
| 136 | + $column[0]+=2; |
|
| 137 | + if ($column[0]>25) { |
|
| 138 | 138 | if (isset($column[1])) { |
| 139 | - $column[1] += 1; |
|
| 140 | - if ($column[1] > 25) { |
|
| 139 | + $column[1]+=1; |
|
| 140 | + if ($column[1]>25) { |
|
| 141 | 141 | if (isset($column[2])) { |
| 142 | - $column[2] += 1; |
|
| 142 | + $column[2]+=1; |
|
| 143 | 143 | } else { |
| 144 | - $column[2] = 0; |
|
| 144 | + $column[2]=0; |
|
| 145 | 145 | } |
| 146 | 146 | } |
| 147 | 147 | } else { |
| 148 | - $column[1] = 0; |
|
| 148 | + $column[1]=0; |
|
| 149 | 149 | } |
| 150 | 150 | } |
| 151 | - $columns_str[$key] = ''; |
|
| 152 | - $reverse_column = array_reverse($column); |
|
| 151 | + $columns_str[$key]=''; |
|
| 152 | + $reverse_column=array_reverse($column); |
|
| 153 | 153 | foreach ($reverse_column as $ord) { |
| 154 | - $columns_str[$key] .= $chars[$ord]; |
|
| 154 | + $columns_str[$key].=$chars[$ord]; |
|
| 155 | 155 | } |
| 156 | - $columns_str[$key] .= '1'; |
|
| 156 | + $columns_str[$key].='1'; |
|
| 157 | 157 | } |
| 158 | 158 | return $columns_str[0].':'.$columns_str[1]; |
| 159 | 159 | } |