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:
10
10
11
11
ignoreErrors:
12
12
- '#Unsafe usage of new static\(\).#'
13
+ - '#Negated boolean expression is always false.#'
13
14
14
15
excludePaths:
15
16
- src/helper.php
Original file line number Diff line number Diff line change @@ -254,7 +254,9 @@ public function getBaseRequest(): BaseRequest
254
254
*/
255
255
public function start (): int
256
256
{
257
- return intval ($ this ->request ->input ('start ' , 0 ));
257
+ $ start = $ this ->request ->input ('start ' , 0 );
258
+
259
+ return is_numeric ($ start ) ? intval ($ start ) : 0 ;
258
260
}
259
261
260
262
/**
@@ -264,7 +266,9 @@ public function start(): int
264
266
*/
265
267
public function length (): int
266
268
{
267
- return intval ($ this ->request ->input ('length ' , 10 ));
269
+ $ length = $ this ->request ->input ('length ' , 10 );
270
+
271
+ return is_numeric ($ length ) ? intval ($ length ) : 10 ;
268
272
}
269
273
270
274
/**
@@ -274,6 +278,8 @@ public function length(): int
274
278
*/
275
279
public function draw (): int
276
280
{
277
- return intval ($ this ->request ->input ('draw ' , 0 ));
281
+ $ draw = $ this ->request ->input ('draw ' , 0 );
282
+
283
+ return is_numeric ($ draw ) ? intval ($ draw ) : 0 ;
278
284
}
279
285
}
You can’t perform that action at this time.
0 commit comments