Closed brettsmason closed 3 years ago
getType()
will require a min. PHP version bump to 7. Currently, we support down to 5.6, but I'm good with bumping it.
This might work for line 395. It needs testing on PHP 7 and 8:
// Replace this line:
} elseif ( ! is_null( $dependency->getClass() ) ) {
// With this:
} elseif ( ! is_null( $dependency->getType() ) ) {
// Alternate idea:
} elseif ( ! is_null( $dependency->getType() ) && class_exists( $dependency->getType()->getName() ) ) {
And, I forgot line 397:
// Replace this line:
$args[] = $this->resolve( $dependency->getClass()->getName() );
// With this:
$args[] = $this->resolve( $dependency->getType()->getName() );
Can confirm that removes the deprecated notice and continues to work fine.
It seems to be working for me. getType()->getName()
is undocumented in PHP, so I'd like to at least get one more person to verify this is working.
Can anyone test down to 7.0? I'd like to make sure we have a minimum version.
For v6, I am ok with PHP v5.6 compatibility. Can bump it to at least PHP 7.3 in v6.1.
Will test it out on PHP v5.6, v7.3, v7.4 & v8.
and update the code as well if things are working fine.
Testing the 6.0 branch on my PHP 8 setup and am getting the following error:
From reading this it looks like this should be updated to
ReflectionParameter::getType()
.