safe
safe copied to clipboard
All PHP functions, rewritten to throw exceptions instead of returning false
The new configuration is this: ```php
Hi, Consider the following code using the standard `json_decode` PHP function ```php \json_decode('"incorrect json'); echo 'Error : ' . json_last_error() . PHP_EOL; \json_decode('"correct json agin"'); echo 'Error : ' ....
Hi there, I was reading [this thread](https://twitter.com/another_clue/status/1503830167252307973) on Twitter by [Christian Lück](https://twitter.com/another_clue) and I immediately thought on Safe. I just checked and just like on his example, this library [uses](https://github.com/thecodingmachine/safe/blob/v2.1.2/generated/Exceptions/FilesystemException.php#L8)...
I think this library is really great, thanks for creating and supporting it! One aspect that I feel could be better is the current use of functions instead of methods....
#### Summary In the nearer past, many functions have been changed to throw an `\ErrorException` which previously used to generate emit a PHP engine error on failure. This is also...
This is a feature request to add support for the `openssl_x509_parse` function. Ref: https://www.php.net/manual/fr/function.openssl-x509-parse.php
As title, some `exif_*` functions are missed. These functions are as follows: - [exif_imagetype](https://www.php.net/manual/en/function.exif-imagetype.php) ``` exif_imagetype('/not/found') PHP Warning: exif_imagetype(/not/found): failed to open stream: No such file or directory ``` -...
Aka. _for machines only_ ``` repo/ ├─ generated/ │ ├─ src/ │ ├─ functions.php ``` - all classes go (generated or copied) in `src` directory as per PSR-4 - all...
Try to fix #332 This is my first serious attempt at a PR on here, so please, any suggestion is welcome. While doing this I realized the implementation for the...
The subject in preg_replace can be a string or an arrays of strings. The return value is the same type as the provided subject. By adding the generics PHPStan 'knows'...