thecodingmachine / safe

All PHP functions, rewritten to throw exceptions instead of returning false
MIT License
2.37k stars 149 forks source link

LDAP - Wrong phpdoc for safe functions after PHP 8.1 #479

Open psuet opened 9 hours ago

psuet commented 9 hours ago

For nearly all LDAP functions in PHP 8.1

The ldap parameter expects an LDAP\Connection instance now; previously, a valid ldap link resource was expected. https://www.php.net/manual/en/function.ldap-add.php

Currently Safe notes that the first parameter is still a resource. Thus PHPStan (and other tooling) returns an error when using the safe functions:

Parameter #1 $ldap of function Safe\ldap_add expects resource|null, LDAP\Connection given.