Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix deprecation warnings thrown when used with PHP 8.4 #32

Merged
merged 3 commits into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
matrix:
operating-system: ['ubuntu-latest', 'macos-latest']
php-versions: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3']
php-versions: ['7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4']
phpunit-versions: ['latest']

steps:
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
}
],
"require": {
"php": "~5.6|~7.0|~8.0",
"php": "~7.1|~8.0",
"paragonie/random_compat": ">=2.0"
},
"require-dev": {
Expand Down
12 changes: 6 additions & 6 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ class Client
*
* @codeCoverageIgnore
* @param integer $size
* @param GeneratorInterface $generator
* @param GeneratorInterface|null $generator
*/
public function __construct($size = 21, GeneratorInterface $generator = null)
public function __construct($size = 21, ?GeneratorInterface $generator = null)
hidehalo marked this conversation as resolved.
Show resolved Hide resolved
{
$this->size = $size > 0 ? $size : 21;
$this->generator = $generator ?: new Generator();
Expand Down Expand Up @@ -67,12 +67,12 @@ public function generateId($size = 0, $mode = self::MODE_NORMAL)
* you have been implements your custom GeneratorInterface as correctly.
* Otherwise use the build-in default random bytes generator
*
* @param GeneratorInterface $generator
* @param GeneratorInterface|null $generator
* @param integer $size
* @param string $alphabet default CoreInterface::SAFE_SYMBOLS
* @return string
*/
public function formattedId($alphabet, $size = 0, GeneratorInterface $generator = null)
public function formattedId($alphabet, $size = 0, ?GeneratorInterface $generator = null)
{
$alphabet = $alphabet ?: CoreInterface::SAFE_SYMBOLS;
$size = $size > 0 ? $size : $this->size;
Expand All @@ -86,12 +86,12 @@ public function formattedId($alphabet, $size = 0, GeneratorInterface $generator
*
* @param string $alphabet
* @param integer $size
* @param GeneratorInterface $generator
* @param GeneratorInterface|null $generator
*
* @return string
* @since 1.0.0
*/
public function formatedId($alphabet, $size = 0, GeneratorInterface $generator = null)
public function formatedId($alphabet, $size = 0, ?GeneratorInterface $generator = null)
{
$size = $size > 0 ? $size : $this->size;

Expand Down
Loading