Skip to content

Commit

Permalink
[NoFile]Cache/SetTest: pass correct type to base_convert()
Browse files Browse the repository at this point in the history
The PHP native `base_convert()` function expects a string as the first parameter. While this is not really a problem, as without `strict_types`, PHP will just juggle the type from `int` to `string`, it is still good to be explicit.

Ref: https://www.php.net/manual/en/function.base-convert.php
  • Loading branch information
jrfnl committed Aug 25, 2023
1 parent 68925d0 commit 6a55ba5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Tests/Internal/Cache/SetTest.php
Expand Up @@ -95,7 +95,7 @@ public static function resetCachingStatus()
*/
public function testSetAcceptsEveryTypeOfInput($input)
{
$id = \base_convert(\rand((int) 10e16, (int) 10e20), 10, 36);
$id = \base_convert((string) \rand((int) 10e16, (int) 10e20), 10, 36);
Cache::set(self::$phpcsFile, __METHOD__, $id, $input);

$this->assertTrue(
Expand Down
2 changes: 1 addition & 1 deletion Tests/Internal/NoFileCache/SetTest.php
Expand Up @@ -89,7 +89,7 @@ public static function resetCachingStatus()
*/
public function testSetAcceptsEveryTypeOfInput($input)
{
$id = \base_convert(\rand((int) 10e16, (int) 10e20), 10, 36);
$id = \base_convert((string) \rand((int) 10e16, (int) 10e20), 10, 36);
NoFileCache::set(__METHOD__, $id, $input);

$this->assertTrue(
Expand Down

0 comments on commit 6a55ba5

Please sign in to comment.