Skip to content

Commit

Permalink
Deprecate Pager::sanitizePageNumber method
Browse files Browse the repository at this point in the history
  • Loading branch information
natanfelles committed Jun 17, 2022
1 parent a805626 commit 4a727ac
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/Pager.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use Framework\Language\Language;
use InvalidArgumentException;
use JetBrains\PhpStorm\ArrayShape;
use JetBrains\PhpStorm\Deprecated;
use JetBrains\PhpStorm\Pure;
use JsonSerializable;
use LogicException;
Expand Down Expand Up @@ -453,10 +454,20 @@ public function jsonSerialize() : array
* @param int|string $number
*
* @return int
*
* @deprecated Use sanitize method
* @codeCoverageIgnore
*/
#[Pure]
#[Deprecated(
reason: 'since version 3.1, use sanitize() instead',
replacement: '%class%::sanitize(%parameter0%)'
)]
public static function sanitizePageNumber(int | string $number) : int
{
\trigger_error(
'Method ' . __METHOD__ . ' is deprecated',
\E_USER_DEPRECATED
);
$number = $number < 1 || ! \is_numeric($number) ? 1 : $number;
return $number > \PHP_INT_MAX ? \PHP_INT_MAX : (int) $number;
}
Expand Down

0 comments on commit 4a727ac

Please sign in to comment.