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

Regenerate with php8.1 #430

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 11 additions & 0 deletions generated/Exceptions/RnpException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php
namespace Safe\Exceptions;

class RnpException extends \ErrorException implements SafeExceptionInterface
{
public static function createFromPhpError(): self
{
$error = error_get_last();
return new self($error['message'] ?? 'An error occurred', 0, $error['type'] ?? 1);
}
}
19 changes: 0 additions & 19 deletions generated/array.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,3 @@ function array_walk_recursive(&$array, callable $callback, $arg = null): void
throw ArrayException::createFromPhpError();
}
}


/**
* This function shuffles (randomizes the order of the elements in) an array.
* It uses a pseudo random number generator that is not suitable for
* cryptographic purposes.
*
* @param array $array The array.
* @throws ArrayException
*
*/
function shuffle(array &$array): void
{
error_clear_last();
$safeResult = \shuffle($array);
if ($safeResult === false) {
throw ArrayException::createFromPhpError();
}
}
3 changes: 2 additions & 1 deletion generated/classobj.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
*
* @param string $class The original class.
* @param string $alias The alias name for the class.
* @param bool $autoload Whether to autoload if the original class is not found.
* @param bool $autoload Whether to autoload
* if the original class is not found.
* @throws ClassobjException
*
*/
Expand Down