Skip to content

Commit 3ebada4

Browse files
Fix Mage_Core_Model_Layout helper extension
1 parent 46e25db commit 3ebada4

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/Type/Mage/Core/Model/Layout/HelperMethodsReturnTypeExtension.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace PHPStanMagento1\Type\Mage;
44

5-
use PhpParser\Node\Expr\StaticCall;
5+
use PhpParser\Node\Expr\MethodCall;
66
use PhpParser\Node\Scalar\String_;
77
use PHPStan\Analyser\Scope;
88
use PHPStan\Reflection\MethodReflection;
@@ -13,14 +13,15 @@
1313

1414
use Mage_Core_Model_Layout;
1515

16+
1617
class HelperMethodsReturnTypeExtension implements DynamicMethodReturnTypeExtension
1718
{
1819
public function getClass(): string
1920
{
20-
return Mage_Core_Model_Layout;
21+
return Mage_Core_Model_Layout::class;
2122
}
2223

23-
public function isStaticMethodSupported(MethodReflection $methodReflection): bool
24+
public function isMethodSupported(MethodReflection $methodReflection): bool
2425
{
2526
return in_array(
2627
$methodReflection->getName(),
@@ -31,7 +32,7 @@ public function isStaticMethodSupported(MethodReflection $methodReflection): boo
3132
);
3233
}
3334

34-
public function getTypeFromStaticMethodCall(MethodReflection $methodReflection, StaticCall $methodCall, Scope $scope): Type
35+
public function getTypeFromMethodCall(MethodReflection $methodReflection, MethodCall $methodCall, Scope $scope): Type
3536
{
3637
if (!isset($methodCall->args[0]) || !$methodCall->args[0]->value instanceof String_) {
3738
throw new ShouldNotHappenException();

0 commit comments

Comments
 (0)