safe icon indicating copy to clipboard operation
safe copied to clipboard

All PHP functions, rewritten to throw exceptions instead of returning false

Results 109 safe issues
Sort by recently updated
recently updated
newest added

Psalm has a list of templated functions here: https://github.com/vimeo/psalm/blob/master/src/Psalm/Internal/Stubs/CoreGenericFunctions.php The big benefit of those is that they allow static analysis to figure out what's happening in a bunch of common...

To be handled in special cases: - [x] json_decode (it returns null on error) - [ ] all functions that are in double (in the PHPDoc, some functions are declared...

PHP 7.4 will make a breaking change for `password_hash()`, changing `PASSWORD_DEFAULT` to `null` and allowing the algorithm (second parameter `$algo`) to be `null` and also accept strings while throwing deprecation...

It's a common extension and lots of their methods return `false` on failure, which is frustrating. How would I go about adding it? Great repo btw!

enhancement
missing function

Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action

regenerate
auto

https://www.php.net/manual/en/function.stream-filter-append.php Defines `stream_filter_append` as : ``` stream_filter_append( resource $stream, string $filtername, int $read_write = ?, [mixed](https://www.php.net/manual/en/language.types.declarations.php#language.types.declarations.mixed) $params = ? ): resource ``` This PR aims to fix the inconsistency as...

`preg_match_all` returns `?int` This is (as far as I can tell) not correct, this method could only ever return an integer. This seems to have been introduced by https://github.com/thecodingmachine/safe/pull/335 in...

When iterating over a file we get an Exception if the last line is empty. Is this intended?

According to [PHP documentation](https://www.php.net/openssl_x509_read), openssl_x509_read accept `OpenSSLCertificate|string` and return `OpenSSLCertificate|false`. On generated Safe wrapper, types are currently `ressource|string` and `resource`, making static analyzer fail when passing and OpenSSLCertificate instance, or...

Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action

regenerate
auto