safe
safe copied to clipboard
All PHP functions, rewritten to throw exceptions instead of returning false
Starting with PHP 8.0 the GdImage class objects replace GD image resources: https://php.watch/versions/8.0/gdimage Will open a PR later.
# Environment **PHP version:** 8.1.28 **PHPStan version:** 1.11.1 **Safe version:** 2.5.0 **PHPStan Safe Rule version:** 1.2.0 # Description of problem When creating a constant using the `Safe\define()` function, and the...
There doesn't seem to be a Safe implementation of [get_cfg_var()](https://www.php.net/manual/en/function.get-cfg-var.php), which returns the config value as string or array on success, but boolean FALSE on error.
- Added php 8.2 and 8.3 support - Bumped minimum version to php 8.2 - Added more code quality tools: phpcs, phpstan, rector - Added support for phpunit 10 and...
If the zip archive contains an empty file, the `getFromIndex()` function in the safe library throws an exception. Exception message states "Failed to extract file from the zip archive: No...
I'm currently refactoring a large code base. I'm using rector and this wonderful library to make it safer :-) I stumbled upon `shuffle` and wonder: why? In which circumstances does...
It looks like there is not much activity here, so I would offer my help to maintain this repository. Cheers, Oskar cc @mvhirsch @igst @silasjoisten @localheinz @staabm
Look like `openssl_random_pseudo_bytes` is not implemented as `Safe\`-variant. Could we add this one, please? https://www.php.net/manual/en/function.openssl-random-pseudo-bytes.php
This handles a rather unpleasant quirk in PHP where if `json_decode` is called without `JSON_THROW_ON_ERROR_FLAG` for an invalid json string before calling `json_decode` for a valid json string with said...
 