Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On the road to phpstan 2.0 compatibility #334

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"php": "^7.2.0 || ^8.1.0",
"ext-dom": "*",
"laminas/laminas-code": "~3.3.0 || ~3.4.1 || ~3.5.1 || ^4.5 || ^4.10",
"phpstan/phpstan": "~1.12.0",
"phpstan/phpstan": "^2.0",
"symfony/finder": "^3.0 || ^4.0 || ^5.0 || ^6.0 || ^7.0"
},
"conflict": {
Expand All @@ -37,10 +37,10 @@
"magento/framework": ">=102.0.0",
"mikey179/vfsstream": "^1.6.10",
"nette/neon": "^3.3.3",
"nikic/php-parser": "^4.13.2",
"nikic/php-parser": "^5.3",
"phpstan/extension-installer": "^1.1.0",
"phpstan/phpstan-phpunit": "^1.1.1",
"phpstan/phpstan-strict-rules": "^1.2.3",
"phpstan/phpstan-phpunit": "^2.0",
"phpstan/phpstan-strict-rules": "^2.0",
"phpunit/phpunit": "^9.5.20",
"squizlabs/php_codesniffer": "^3.6.2"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public function __construct(string $magentoRoot)
$this->composer = new ClassLoader($magentoRoot . '/vendor');
$autoloadFile = $magentoRoot . '/vendor/composer/autoload_namespaces.php';
if (is_file($autoloadFile)) {
/** @var array<string, string> $map */
$map = require $autoloadFile;
foreach ($map as $namespace => $path) {
$this->composer->set($namespace, $path);
Expand All @@ -38,6 +39,7 @@ public function __construct(string $magentoRoot)

$autoloadFile = $magentoRoot . '/vendor/composer/autoload_psr4.php';
if (is_file($autoloadFile)) {
/** @var array<string, string> $map */
$map = require $autoloadFile;
foreach ($map as $namespace => $path) {
$this->composer->setPsr4($namespace, $path);
Expand All @@ -46,6 +48,7 @@ public function __construct(string $magentoRoot)

$autoloadFile = $magentoRoot . '/vendor/composer/autoload_classmap.php';
if (is_file($autoloadFile)) {
/** @var ?array<string, string> $classMap */
$classMap = require $autoloadFile;
if (is_array($classMap)) {
$this->composer->addClassMap($classMap);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ protected function getFileContents(string $class): string
$namespace = explode('\\', ltrim($class, '\\'));
/** @var string $factoryClassname */
$factoryClassname = array_pop($namespace);
$originalClassname = preg_replace('#Factory$#', '', $factoryClassname);
$originalClassname = preg_replace('#Factory$#', '', $factoryClassname) ?? $factoryClassname;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like this change, it's to keep phpstan stop from complaining about preg_replace to return null in case of a failure. Maybe we should mark to ignore this phpstan error?

$namespace = implode('\\', $namespace);

$template = "<?php\n";
Expand Down
4 changes: 3 additions & 1 deletion src/bitExpert/PHPStan/Magento/Autoload/ProxyAutoloader.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,9 @@ protected function getFileContents(string $class): string
$defaultValue = ' = false';
break;
default:
$defaultValue = ' = ' . $parameter->getDefaultValue();
if (is_string($parameter->getDefaultValue())) {
$defaultValue = ' = ' . $parameter->getDefaultValue();
}
Copy link
Contributor Author

@hostep hostep Nov 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if this is a good solution, $parameter->getDefaultValue() returns mixed, so phpstan complained about this concatenation not being with a string.

break;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class MagicMethodReflection implements MethodReflection
*/
private $declaringClass;
/**
* @var ParametersAcceptor[]
* @var list<ParametersAcceptor>
*/
private $variants;

Expand All @@ -37,7 +37,7 @@ class MagicMethodReflection implements MethodReflection
*
* @param string $name
* @param ClassReflection $declaringClass
* @param ParametersAcceptor[] $variants
* @param list<ParametersAcceptor> $variants
*/
public function __construct(string $name, ClassReflection $declaringClass, array $variants = [])
{
Expand Down Expand Up @@ -76,9 +76,6 @@ public function getPrototype(): ClassMemberReflection
return $this;
}

/**
* @return ParametersAcceptor[]
*/
public function getVariants(): array
{
return $this->variants;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
use PhpParser\Node\Expr\MethodCall;
use PHPStan\Analyser\Scope;
use PHPStan\Rules\Rule;
use PHPStan\ShouldNotHappenException;
use PHPStan\Rules\RuleError;
use PHPStan\Rules\RuleErrorBuilder;
use PHPStan\Type\ObjectType;
use PHPStan\Type\VerbosityLevel;

Expand All @@ -36,18 +37,8 @@ public function getNodeType(): string
return MethodCall::class;
}

/**
* @param Node $node
* @param Scope $scope
* @return (string|\PHPStan\Rules\RuleError)[] errors
* @throws ShouldNotHappenException
*/
public function processNode(Node $node, Scope $scope): array
{
if (!$node instanceof MethodCall) {
throw new ShouldNotHappenException();
}

if (!$node->name instanceof Node\Identifier) {
return [];
}
Expand All @@ -63,11 +54,15 @@ public function processNode(Node $node, Scope $scope): array
}

return [
sprintf(
'Collections should be used directly via factory, not via %s::%s() method',
$type->describe(VerbosityLevel::typeOnly()),
$node->name->name
RuleErrorBuilder::message(
sprintf(
'Collections should be used directly via factory, not via %s::%s() method',
$type->describe(VerbosityLevel::typeOnly()),
$node->name->name
)
)
->identifier('bitExpertMagento.abstractModelRetrieveCollectionViaFactory')
->build()
];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
use PhpParser\Node\Expr\MethodCall;
use PHPStan\Analyser\Scope;
use PHPStan\Rules\Rule;
use PHPStan\ShouldNotHappenException;
use PHPStan\Rules\RuleError;
use PHPStan\Rules\RuleErrorBuilder;
use PHPStan\Type\ObjectType;
use PHPStan\Type\VerbosityLevel;

Expand All @@ -36,18 +37,8 @@ public function getNodeType(): string
return MethodCall::class;
}

/**
* @param Node $node
* @param Scope $scope
* @return (string|\PHPStan\Rules\RuleError)[] errors
* @throws ShouldNotHappenException
*/
public function processNode(Node $node, Scope $scope): array
{
if (!$node instanceof MethodCall) {
throw new ShouldNotHappenException();
}

if (!$node->name instanceof Node\Identifier) {
return [];
}
Expand All @@ -63,11 +54,15 @@ public function processNode(Node $node, Scope $scope): array
}

return [
sprintf(
'Use service contracts to persist entities in favour of %s::%s() method',
$type->describe(VerbosityLevel::typeOnly()),
$node->name->name
RuleErrorBuilder::message(
sprintf(
'Use service contracts to persist entities in favour of %s::%s() method',
$type->describe(VerbosityLevel::typeOnly()),
$node->name->name
)
)
->identifier('bitExpertMagento.abstractModelUseServiceContract')
->build()
];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
use PhpParser\Node\Expr\MethodCall;
use PHPStan\Analyser\Scope;
use PHPStan\Rules\Rule;
use PHPStan\ShouldNotHappenException;
use PHPStan\Rules\RuleError;
use PHPStan\Rules\RuleErrorBuilder;
use PHPStan\Type\Constant\ConstantStringType;
use PHPStan\Type\ErrorType;
use PHPStan\Type\ObjectType;
Expand All @@ -38,18 +39,8 @@
return MethodCall::class;
}

/**
* @param Node $node
* @param Scope $scope
* @return (string|\PHPStan\Rules\RuleError)[] errors
* @throws ShouldNotHappenException
*/
public function processNode(Node $node, Scope $scope): array
{
if (!$node instanceof MethodCall) {
throw new ShouldNotHappenException();
}

if (!$node->name instanceof Node\Identifier) {
return [];
}
Expand Down Expand Up @@ -77,12 +68,17 @@
/** @var \PhpParser\Node\Arg[] $args */
$args = $node->args;
/** @var ConstantStringType $argType */
$argType = $scope->getType($args[0]->value);

Check failure on line 71 in src/bitExpert/PHPStan/Magento/Rules/GetCollectionMockMethodNeedsCollectionSubclassRule.php

View workflow job for this annotation

GitHub Actions / run (8.1, 2.4.5, ubuntu-latest)

PHPDoc tag @var assumes the expression with type PHPStan\Type\Type is always PHPStan\Type\Constant\ConstantStringType but it's error-prone and dangerous.

Check failure on line 71 in src/bitExpert/PHPStan/Magento/Rules/GetCollectionMockMethodNeedsCollectionSubclassRule.php

View workflow job for this annotation

GitHub Actions / run (ubuntu-latest, 7.4, 2.4.3, false)

PHPDoc tag @var assumes the expression with type PHPStan\Type\Type is always PHPStan\Type\Constant\ConstantStringType but it's error-prone and dangerous.

Check failure on line 71 in src/bitExpert/PHPStan/Magento/Rules/GetCollectionMockMethodNeedsCollectionSubclassRule.php

View workflow job for this annotation

GitHub Actions / run (8.1, 2.4.4, ubuntu-latest)

PHPDoc tag @var assumes the expression with type PHPStan\Type\Type is always PHPStan\Type\Constant\ConstantStringType but it's error-prone and dangerous.

Check failure on line 71 in src/bitExpert/PHPStan/Magento/Rules/GetCollectionMockMethodNeedsCollectionSubclassRule.php

View workflow job for this annotation

GitHub Actions / run (ubuntu-latest, 7.4, 2.4.2-p2, false)

PHPDoc tag @var assumes the expression with type PHPStan\Type\Type is always PHPStan\Type\Constant\ConstantStringType but it's error-prone and dangerous.

Check failure on line 71 in src/bitExpert/PHPStan/Magento/Rules/GetCollectionMockMethodNeedsCollectionSubclassRule.php

View workflow job for this annotation

GitHub Actions / run (8.1, 2.4.6, ubuntu-latest, true)

PHPDoc tag @var assumes the expression with type PHPStan\Type\Type is always PHPStan\Type\Constant\ConstantStringType but it's error-prone and dangerous.

Check failure on line 71 in src/bitExpert/PHPStan/Magento/Rules/GetCollectionMockMethodNeedsCollectionSubclassRule.php

View workflow job for this annotation

GitHub Actions / run (ubuntu-latest, 7.4, 2.3.7-p2, false)

PHPDoc tag @var assumes the expression with type PHPStan\Type\Type is always PHPStan\Type\Constant\ConstantStringType but it's error-prone and dangerous.

Check failure on line 71 in src/bitExpert/PHPStan/Magento/Rules/GetCollectionMockMethodNeedsCollectionSubclassRule.php

View workflow job for this annotation

GitHub Actions / run (ubuntu-latest, 7.4, 2.4.2, false)

PHPDoc tag @var assumes the expression with type PHPStan\Type\Type is always PHPStan\Type\Constant\ConstantStringType but it's error-prone and dangerous.

Check failure on line 71 in src/bitExpert/PHPStan/Magento/Rules/GetCollectionMockMethodNeedsCollectionSubclassRule.php

View workflow job for this annotation

GitHub Actions / run (ubuntu-latest, 7.4, 2.4.2-p1, false)

PHPDoc tag @var assumes the expression with type PHPStan\Type\Type is always PHPStan\Type\Constant\ConstantStringType but it's error-prone and dangerous.

return [
sprintf(
'%s does not extend \Magento\Framework\Data\Collection as required!',
$argType->getValue()
RuleErrorBuilder::message(
sprintf(
'%s does not extend \Magento\Framework\Data\Collection as required!',
$argType->getValue()
)
)
->identifier('bitExpertMagento.getCollectionMockMethodNeedsCollectionSubclass')
->build()
];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
use PhpParser\Node\Expr\MethodCall;
use PHPStan\Analyser\Scope;
use PHPStan\Rules\Rule;
use PHPStan\ShouldNotHappenException;
use PHPStan\Rules\RuleError;
use PHPStan\Rules\RuleErrorBuilder;
use PHPStan\Type\ObjectType;
use PHPStan\Type\VerbosityLevel;

Expand All @@ -36,18 +37,8 @@ public function getNodeType(): string
return MethodCall::class;
}

/**
* @param Node $node
* @param Scope $scope
* @return (string|\PHPStan\Rules\RuleError)[] errors
* @throws ShouldNotHappenException
*/
public function processNode(Node $node, Scope $scope): array
{
if (!$node instanceof MethodCall) {
throw new ShouldNotHappenException();
}

if (!$node->name instanceof Node\Identifier) {
return [];
}
Expand All @@ -63,11 +54,15 @@ public function processNode(Node $node, Scope $scope): array
}

return [
sprintf(
'%s::%s() is deprecated. Use Resource Models directly',
$type->describe(VerbosityLevel::typeOnly()),
$node->name->name
RuleErrorBuilder::message(
sprintf(
'%s::%s() is deprecated. Use Resource Models directly',
$type->describe(VerbosityLevel::typeOnly()),
$node->name->name
)
)
->identifier('bitExpertMagento.resourceModelsShouldBeUsedDirectly')
->build()
];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
use PhpParser\Node\Expr\MethodCall;
use PHPStan\Analyser\Scope;
use PHPStan\Rules\Rule;
use PHPStan\ShouldNotHappenException;
use PHPStan\Rules\RuleError;
use PHPStan\Rules\RuleErrorBuilder;
use PHPStan\Type\ObjectType;
use PHPStan\Type\VerbosityLevel;

Expand All @@ -37,18 +38,8 @@ public function getNodeType(): string
return MethodCall::class;
}

/**
* @param Node $node
* @param Scope $scope
* @return (string|\PHPStan\Rules\RuleError)[] errors
* @throws ShouldNotHappenException
*/
public function processNode(Node $node, Scope $scope): array
{
if (!$node instanceof MethodCall) {
throw new ShouldNotHappenException();
}

if (!$node->name instanceof Node\Identifier) {
return [];
}
Expand All @@ -64,11 +55,15 @@ public function processNode(Node $node, Scope $scope): array
}

return [
sprintf(
'Setter methods like %s::%s() are deprecated in Block classes, use constructor arguments instead',
$type->describe(VerbosityLevel::typeOnly()),
$node->name->name
RuleErrorBuilder::message(
sprintf(
'Setter methods like %s::%s() are deprecated in Block classes, use constructor arguments instead',
$type->describe(VerbosityLevel::typeOnly()),
$node->name->name
)
)
->identifier('bitExpertMagento.setTemplateDisallowedForBlock')
->build()
];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@

class ObjectManagerDynamicReturnTypeExtension implements DynamicMethodReturnTypeExtension
{
/**
* @return string
*/
public function getClass(): string
{
return 'Magento\Framework\App\ObjectManager';
Expand Down Expand Up @@ -64,9 +61,15 @@ public function getTypeFromMethodCall(
/** @var \PhpParser\Node\Arg[] $args */
$args = $methodCall->args;
$argType = $scope->getType($args[0]->value);
if (!$argType instanceof ConstantStringType) {
if ($argType->getConstantStrings() === []) {
return $mixedType;
}
return TypeCombinator::addNull(new ObjectType($argType->getValue()));

$types = [];
foreach ($argType->getConstantStrings() as $constantString) {
$types[] = TypeCombinator::addNull(new ObjectType($constantString->getValue()));
}

return TypeCombinator::union(...$types);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@

class TestFrameworkObjectManagerDynamicReturnTypeExtension implements DynamicMethodReturnTypeExtension
{
/**
* @return string
*/
public function getClass(): string
{
return 'Magento\Framework\TestFramework\Unit\Helper\ObjectManager';
Expand Down Expand Up @@ -92,10 +89,16 @@
/** @var \PhpParser\Node\Arg[] $args */
$args = $methodCall->args;
$argType = $scope->getType($args[0]->value);
if (!$argType instanceof ConstantStringType) {
if ($argType->getConstantStrings() === []) {
return $mixedType;
}
return TypeCombinator::addNull(new ObjectType($argType->getValue()));

$types = [];
foreach ($argType->getConstantStrings() as $constantString) {
$types[] = TypeCombinator::addNull(new ObjectType($constantString->getValue()));
}

return TypeCombinator::union(...$types);
}

/**
Expand Down Expand Up @@ -126,10 +129,10 @@
/** @var \PhpParser\Node\Arg[] $args */
$args = $methodCall->args;
/** @var ConstantStringType $type */
$type = $scope->getType($args[0]->value);

Check failure on line 132 in src/bitExpert/PHPStan/Magento/Type/TestFrameworkObjectManagerDynamicReturnTypeExtension.php

View workflow job for this annotation

GitHub Actions / run (8.1, 2.4.5, ubuntu-latest)

PHPDoc tag @var assumes the expression with type PHPStan\Type\Type is always PHPStan\Type\Constant\ConstantStringType but it's error-prone and dangerous.

Check failure on line 132 in src/bitExpert/PHPStan/Magento/Type/TestFrameworkObjectManagerDynamicReturnTypeExtension.php

View workflow job for this annotation

GitHub Actions / run (ubuntu-latest, 7.4, 2.4.3, false)

PHPDoc tag @var assumes the expression with type PHPStan\Type\Type is always PHPStan\Type\Constant\ConstantStringType but it's error-prone and dangerous.

Check failure on line 132 in src/bitExpert/PHPStan/Magento/Type/TestFrameworkObjectManagerDynamicReturnTypeExtension.php

View workflow job for this annotation

GitHub Actions / run (8.1, 2.4.4, ubuntu-latest)

PHPDoc tag @var assumes the expression with type PHPStan\Type\Type is always PHPStan\Type\Constant\ConstantStringType but it's error-prone and dangerous.

Check failure on line 132 in src/bitExpert/PHPStan/Magento/Type/TestFrameworkObjectManagerDynamicReturnTypeExtension.php

View workflow job for this annotation

GitHub Actions / run (ubuntu-latest, 7.4, 2.4.2-p2, false)

PHPDoc tag @var assumes the expression with type PHPStan\Type\Type is always PHPStan\Type\Constant\ConstantStringType but it's error-prone and dangerous.

Check failure on line 132 in src/bitExpert/PHPStan/Magento/Type/TestFrameworkObjectManagerDynamicReturnTypeExtension.php

View workflow job for this annotation

GitHub Actions / run (8.1, 2.4.6, ubuntu-latest, true)

PHPDoc tag @var assumes the expression with type PHPStan\Type\Type is always PHPStan\Type\Constant\ConstantStringType but it's error-prone and dangerous.

Check failure on line 132 in src/bitExpert/PHPStan/Magento/Type/TestFrameworkObjectManagerDynamicReturnTypeExtension.php

View workflow job for this annotation

GitHub Actions / run (ubuntu-latest, 7.4, 2.3.7-p2, false)

PHPDoc tag @var assumes the expression with type PHPStan\Type\Type is always PHPStan\Type\Constant\ConstantStringType but it's error-prone and dangerous.

Check failure on line 132 in src/bitExpert/PHPStan/Magento/Type/TestFrameworkObjectManagerDynamicReturnTypeExtension.php

View workflow job for this annotation

GitHub Actions / run (ubuntu-latest, 7.4, 2.4.2, false)

PHPDoc tag @var assumes the expression with type PHPStan\Type\Type is always PHPStan\Type\Constant\ConstantStringType but it's error-prone and dangerous.

Check failure on line 132 in src/bitExpert/PHPStan/Magento/Type/TestFrameworkObjectManagerDynamicReturnTypeExtension.php

View workflow job for this annotation

GitHub Actions / run (ubuntu-latest, 7.4, 2.4.2-p1, false)

PHPDoc tag @var assumes the expression with type PHPStan\Type\Type is always PHPStan\Type\Constant\ConstantStringType but it's error-prone and dangerous.
/** @var string $className */
$className = $type->getValue();
if (!is_subclass_of($className, 'Magento\Framework\Data\Collection')) {

Check failure on line 135 in src/bitExpert/PHPStan/Magento/Type/TestFrameworkObjectManagerDynamicReturnTypeExtension.php

View workflow job for this annotation

GitHub Actions / run (8.1, 2.4.5, ubuntu-latest)

Function is_subclass_of() is a runtime reflection concept that might not work in PHPStan because it uses fully static reflection engine. Use objects retrieved from ReflectionProvider instead.

Check failure on line 135 in src/bitExpert/PHPStan/Magento/Type/TestFrameworkObjectManagerDynamicReturnTypeExtension.php

View workflow job for this annotation

GitHub Actions / run (ubuntu-latest, 7.4, 2.4.3, false)

Function is_subclass_of() is a runtime reflection concept that might not work in PHPStan because it uses fully static reflection engine. Use objects retrieved from ReflectionProvider instead.

Check failure on line 135 in src/bitExpert/PHPStan/Magento/Type/TestFrameworkObjectManagerDynamicReturnTypeExtension.php

View workflow job for this annotation

GitHub Actions / run (8.1, 2.4.4, ubuntu-latest)

Function is_subclass_of() is a runtime reflection concept that might not work in PHPStan because it uses fully static reflection engine. Use objects retrieved from ReflectionProvider instead.

Check failure on line 135 in src/bitExpert/PHPStan/Magento/Type/TestFrameworkObjectManagerDynamicReturnTypeExtension.php

View workflow job for this annotation

GitHub Actions / run (ubuntu-latest, 7.4, 2.4.2-p2, false)

Function is_subclass_of() is a runtime reflection concept that might not work in PHPStan because it uses fully static reflection engine. Use objects retrieved from ReflectionProvider instead.

Check failure on line 135 in src/bitExpert/PHPStan/Magento/Type/TestFrameworkObjectManagerDynamicReturnTypeExtension.php

View workflow job for this annotation

GitHub Actions / run (8.1, 2.4.6, ubuntu-latest, true)

Function is_subclass_of() is a runtime reflection concept that might not work in PHPStan because it uses fully static reflection engine. Use objects retrieved from ReflectionProvider instead.

Check failure on line 135 in src/bitExpert/PHPStan/Magento/Type/TestFrameworkObjectManagerDynamicReturnTypeExtension.php

View workflow job for this annotation

GitHub Actions / run (ubuntu-latest, 7.4, 2.3.7-p2, false)

Function is_subclass_of() is a runtime reflection concept that might not work in PHPStan because it uses fully static reflection engine. Use objects retrieved from ReflectionProvider instead.

Check failure on line 135 in src/bitExpert/PHPStan/Magento/Type/TestFrameworkObjectManagerDynamicReturnTypeExtension.php

View workflow job for this annotation

GitHub Actions / run (ubuntu-latest, 7.4, 2.4.2, false)

Function is_subclass_of() is a runtime reflection concept that might not work in PHPStan because it uses fully static reflection engine. Use objects retrieved from ReflectionProvider instead.

Check failure on line 135 in src/bitExpert/PHPStan/Magento/Type/TestFrameworkObjectManagerDynamicReturnTypeExtension.php

View workflow job for this annotation

GitHub Actions / run (ubuntu-latest, 7.4, 2.4.2-p1, false)

Function is_subclass_of() is a runtime reflection concept that might not work in PHPStan because it uses fully static reflection engine. Use objects retrieved from ReflectionProvider instead.
return new \PHPStan\Type\ErrorType();
}

Expand Down
Loading
Loading