Skip to content

Commit

Permalink
Apply fixes from StyleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
StyleCIBot committed Oct 7, 2023
1 parent 22bcb4e commit 97c477f
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 15 deletions.
4 changes: 2 additions & 2 deletions app/Entities/Team.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public function getProblemAcceptTime($pid)
/**
* 获取单个题目的罚时.
*
* @param $pid
* @param $pid
* @return mixed
*/
public function getPenaltyOfProblem($pid)
Expand All @@ -168,7 +168,7 @@ public function getPenaltyOfProblem($pid)
/**
* 获取题目的尝试次数.
*
* @param $pid
* @param $pid
* @return mixed
*/
public function getProblemWACount($pid)
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Admin/DataController.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function store()
}

/**
* @param $id
* @param $id
* @return mixed
*
* @throws \Illuminate\Database\Eloquent\ModelNotFoundException
Expand Down
4 changes: 2 additions & 2 deletions app/Http/Controllers/Web/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ public function show($username)
{
/** @var User $user */
$user = app(UserService::class)->findByName($username);
if (!$user) {
if (! $user) {
// user may not exist
return redirect(route('home'))->withErrors('user is not exist!');
}

if (!$user->isActive()) {
if (! $user->isActive()) {
return back()->withErrors('User is not found!');
}

Expand Down
2 changes: 1 addition & 1 deletion app/Http/Middleware/SetupConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
class SetupConfig
{
/**
* @param $request
* @param $request
* @param \Closure $next
* @return mixed
*/
Expand Down
2 changes: 1 addition & 1 deletion app/Hustoj/Hashing/Hasher.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ protected function isDeprecated($password)
/**
* detect charactor is 0-9a-z.
*
* @param $char
* @param $char
* @return bool
*/
private function isCharactorInHexScope($char)
Expand Down
3 changes: 2 additions & 1 deletion app/Services/ContestService.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@ public function getContestPermission(Contest $contest)
public function getProblemByOrder(Contest $contest, $order): Problem
{
$order = strtoupper($order);
if (!is_alpha($order)) {
if (! is_alpha($order)) {
throw new InvalidOrder();
}

return $contest->problems()
->wherePivot('order', '=', original_order($order))
->first();
Expand Down
6 changes: 3 additions & 3 deletions app/Services/DataProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function getData($id)
}

/**
* @param $id
* @param $id
* @return array
*
* @throws \Illuminate\Contracts\Filesystem\FileNotFoundException
Expand All @@ -47,7 +47,7 @@ public function getInputFiles($id)
}

/**
* @param $id
* @param $id
* @return string
*/
public function getDataPath($id)
Expand All @@ -56,7 +56,7 @@ public function getDataPath($id)
}

/**
* @param $id
* @param $id
* @return array
*
* @throws \Illuminate\Contracts\Filesystem\FileNotFoundException
Expand Down
2 changes: 1 addition & 1 deletion app/Services/JudgerService.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ private function exist($name)
}

/**
* @param $code
* @param $code
* @return Judger
*/
public function getJudger($code)
Expand Down
2 changes: 1 addition & 1 deletion app/Services/ProblemService.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function numberOfSubmitUser($problemId)
}

/**
* @param $problemId
* @param $problemId
* @return array
*/
public function getResultCount($problemId)
Expand Down
6 changes: 4 additions & 2 deletions app/Support/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ function captcha_enabled(): bool

if (! function_exists('is_alpha')) {
/**
* detect is only alpha string
* @param $s
* detect is only alpha string.
*
* @param $s
* @return bool
*/
function is_alpha($s): bool
Expand Down Expand Up @@ -164,6 +165,7 @@ function opening_contest()
function original_order($order)
{
$order = strtoupper($order);

return ord($order) - ord('A');
}
}
Expand Down

0 comments on commit 97c477f

Please sign in to comment.