Closed shaneneuerburg closed 3 years ago
@shaneneuerburg thanks for contributing to Restler
Can you also make a pull request to the latest version of restler currently located in https://github.com/Arul-/reactive-restler ?
I checked it out, existing code that checks for PHP 7.0.0 itself solves the problem with PHP 8
$type = version_compare(phpversion(), '7.0.0', '<') ?
// PHP < 7.0
($param->isArray() ? 'array' : $param->getClass()) :
// PHP >= 7.0
($param->getType() && $param->getType()->getName() === 'array' ? 'array' : (
$param->getType() && !$param->getType()->isBuiltin()
? new ReflectionClass($param->getType()->getName())
: null
));
is good enough! are you sure you are receiving warnings?
I was wrong! sorry for the confusion, let me manually merge it to the v5 branch which soon appears in the master
Manually merged in 3ab80a512fa90a7d89d5ef81dcb4c441f5ae6c91
This is a backwards compatible fix that resolves PHP 8.0 deprecation warnings:
https://www.php.net/manual/en/reflectionparameter.isarray.php https://www.php.net/manual/en/reflectionparameter.getclass.php
For PHP prior to 8.0, this will retain the original method calls. For 8.0+, it will use the new getType method on ReflectionParameter.