Skip to content

Commit

Permalink
Regenerate with php8.1
Browse files Browse the repository at this point in the history
(except datetime and gmp modules)
  • Loading branch information
simPod committed Oct 23, 2023
1 parent 3a6e43b commit 1395992
Show file tree
Hide file tree
Showing 33 changed files with 1,201 additions and 1,726 deletions.
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
Loading

0 comments on commit 1395992

Please sign in to comment.