safe
safe copied to clipboard
All PHP functions, rewritten to throw exceptions instead of returning false
Resolves #270 (is not generated from docs)
[hash_file](https://www.php.net/manual/en/function.hash-file.php) can return `string` or `false`. It would be nice if we had a safer version of this function which would throw an exception if it returned `false`.
[str|int|bool|float]val PHP functions generate phpstan errors (these errors appear at level 9 and are legitimate) (source: https://github.com/phpstan/phpstan/issues/9295 ). Would it be interesting to add them to Safe ?
The code is: ```php /** * @return \__benevolent This function will return an array of option / argument pairs. */ function getopt(string $short_options, array $long_options = [], ?int &$rest_index =...
If you (or your framework) calls the native `json_decode` function with an invalid JSON string, it will save the last error in `json_last_error()`. If you then call the Safe function,...
Could be a good idea? - [proc_open](https://www.php.net/manual/en/function.proc-open.php) returns false on error - [proc_close](https://www.php.net/manual/en/function.proc-close.php) returns -1 on error Note: [proc_nice](https://www.php.net/manual/en/function.proc-nice.php) exists: https://github.com/thecodingmachine/safe/blob/3a6e43b4be3d3d65b272c2660300a50658ce168b/generated/exec.php#L95-L102
Bumps [guzzlehttp/psr7](https://github.com/guzzle/psr7) from 2.4.0 to 2.5.0. Release notes Sourced from guzzlehttp/psr7's releases. 2.5.0 See change log for changes. 2.4.5 See change log for changes. 2.4.4 See change log for changes....
Hi 👋🏼 , it might be related to https://github.com/thecodingmachine/safe/issues/53 or https://github.com/thecodingmachine/safe/issues/253 The problem: - I've two projects `projectA/` and `projectB/` - completely separate projects, distinct namespacs, both using composer autoloading...
In PHP8+, there is a new return type `OpenSSLAsymmetricKey` on the function `openssl_pkey_get_private` , but the `safe\openssl_sign` does not allow this type as the `private_key` parameter. You can get details...
Regenerated the files, deleted all deprecated functions, bumped the minimum php version to 8.1