Skip to content

Commit

Permalink
Improve compatibility with nikic/php-parser 4.13.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Sep 20, 2021
1 parent cbe261e commit 1767581
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function getTypeFromStaticMethodCall(
{
$defaultReturnType = new ObjectType('Mockery\\MockInterface');

$args = $methodCall->args;
$args = $methodCall->getArgs();
if (count($args) > 1) {
array_shift($args);
}
Expand Down
4 changes: 2 additions & 2 deletions src/Mockery/Type/MockDynamicReturnTypeExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ public function getTypeFromStaticMethodCall(
): Type
{
$defaultReturnType = new ObjectType('Mockery\\MockInterface');
if (count($methodCall->args) === 0) {
if (count($methodCall->getArgs()) === 0) {
return $defaultReturnType;
}

$types = [$defaultReturnType];
foreach ($methodCall->args as $arg) {
foreach ($methodCall->getArgs() as $arg) {
$classType = $scope->getType($arg->value);
if (!$classType instanceof ConstantStringType) {
continue;
Expand Down

0 comments on commit 1767581

Please sign in to comment.