Don't call class_exists() on null
This commit is contained in:
parent
9c3ee3d82e
commit
88520e53b2
@ -43,7 +43,7 @@ class LazyLoadingValueHolderGenerator extends BaseGenerator
|
||||
public function getProxifiedClass(Definition $definition): ?string
|
||||
{
|
||||
if (!$definition->hasTag('proxy')) {
|
||||
return class_exists($class = $definition->getClass()) || interface_exists($class, false) ? $class : null;
|
||||
return ($class = $definition->getClass()) && (class_exists($class) || interface_exists($class, false)) ? $class : null;
|
||||
}
|
||||
if (!$definition->isLazy()) {
|
||||
throw new \InvalidArgumentException(sprintf('Invalid definition for service of class "%s": setting the "proxy" tag on a service requires it to be "lazy".', $definition->getClass()));
|
||||
|
@ -88,8 +88,13 @@ final class CheckTypeDeclarationsPass extends AbstractRecursivePass
|
||||
return parent::processValue($value, $isRoot);
|
||||
}
|
||||
|
||||
if (!$this->autoload && !class_exists($class = $value->getClass(), false) && !interface_exists($class, false)) {
|
||||
return parent::processValue($value, $isRoot);
|
||||
if (!$this->autoload) {
|
||||
if (!$class = $value->getClass()) {
|
||||
return parent::processValue($value, $isRoot);
|
||||
}
|
||||
if (!class_exists($class, false) && !interface_exists($class, false)) {
|
||||
return parent::processValue($value, $isRoot);
|
||||
}
|
||||
}
|
||||
|
||||
if (ServiceLocator::class === $value->getClass()) {
|
||||
|
Reference in New Issue
Block a user