Skip to content

Commit

Permalink
fix: phpstan (#3022)
Browse files Browse the repository at this point in the history
  • Loading branch information
yajra authored Jun 27, 2023
1 parent 2549a99 commit 0119a1a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ parameters:

ignoreErrors:
- '#Unsafe usage of new static\(\).#'
- '#Negated boolean expression is always false.#'

excludePaths:
- src/helper.php
Expand Down
12 changes: 9 additions & 3 deletions src/Utilities/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,9 @@ public function getBaseRequest(): BaseRequest
*/
public function start(): int
{
return intval($this->request->input('start', 0));
$start = $this->request->input('start', 0);

return is_numeric($start) ? intval($start) : 0;
}

/**
Expand All @@ -264,7 +266,9 @@ public function start(): int
*/
public function length(): int
{
return intval($this->request->input('length', 10));
$length = $this->request->input('length', 10);

return is_numeric($length) ? intval($length) : 10;
}

/**
Expand All @@ -274,6 +278,8 @@ public function length(): int
*/
public function draw(): int
{
return intval($this->request->input('draw', 0));
$draw = $this->request->input('draw', 0);

return is_numeric($draw) ? intval($draw) : 0;
}
}

0 comments on commit 0119a1a

Please sign in to comment.