File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ parameters:
1010
1111 ignoreErrors:
1212 - '#Unsafe usage of new static\(\).#'
13+ - '#Negated boolean expression is always false.#'
1314
1415 excludePaths:
1516 - src/helper.php
Original file line number Diff line number Diff line change @@ -254,7 +254,9 @@ public function getBaseRequest(): BaseRequest
254254 */
255255 public function start (): int
256256 {
257- return intval ($ this ->request ->input ('start ' , 0 ));
257+ $ start = $ this ->request ->input ('start ' , 0 );
258+
259+ return is_numeric ($ start ) ? intval ($ start ) : 0 ;
258260 }
259261
260262 /**
@@ -264,7 +266,9 @@ public function start(): int
264266 */
265267 public function length (): int
266268 {
267- return intval ($ this ->request ->input ('length ' , 10 ));
269+ $ length = $ this ->request ->input ('length ' , 10 );
270+
271+ return is_numeric ($ length ) ? intval ($ length ) : 10 ;
268272 }
269273
270274 /**
@@ -274,6 +278,8 @@ public function length(): int
274278 */
275279 public function draw (): int
276280 {
277- return intval ($ this ->request ->input ('draw ' , 0 ));
281+ $ draw = $ this ->request ->input ('draw ' , 0 );
282+
283+ return is_numeric ($ draw ) ? intval ($ draw ) : 0 ;
278284 }
279285}
You can’t perform that action at this time.
0 commit comments