Skip to content

Commit d698269

Browse files
committed
fixes CI errors
1 parent 29b543f commit d698269

6 files changed

+18
-7
lines changed

Diff for: src/Type/PHPUnit/CreateMockDynamicReturnTypeExtension.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@
88
use PHPStan\Reflection\ParametersAcceptorSelector;
99
use PHPStan\Type\Constant\ConstantArrayType;
1010
use PHPStan\Type\Constant\ConstantStringType;
11+
use PHPStan\Type\DynamicMethodReturnTypeExtension;
1112
use PHPStan\Type\ObjectType;
1213
use PHPStan\Type\Type;
1314
use PHPStan\Type\TypeCombinator;
1415

15-
class CreateMockDynamicReturnTypeExtension implements \PHPStan\Type\DynamicMethodReturnTypeExtension
16+
class CreateMockDynamicReturnTypeExtension implements DynamicMethodReturnTypeExtension
1617
{
1718

1819
/** @var int[] */
@@ -51,7 +52,7 @@ public function getTypeFromMethodCall(MethodReflection $methodReflection, Method
5152
}
5253

5354
if ($argType instanceof ConstantArrayType) {
54-
$types = array_map(function (Type $argType): ObjectType {
55+
$types = array_map(function (ConstantStringType $argType): ObjectType {
5556
return new ObjectType($argType->getValue());
5657
}, $argType->getValueTypes());
5758
}

Diff for: src/Type/PHPUnit/GetMockBuilderDynamicReturnTypeExtension.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@
88
use PHPStan\Reflection\ParametersAcceptorSelector;
99
use PHPStan\Type\Constant\ConstantArrayType;
1010
use PHPStan\Type\Constant\ConstantStringType;
11+
use PHPStan\Type\DynamicMethodReturnTypeExtension;
1112
use PHPStan\Type\Type;
1213
use PHPStan\Type\TypeWithClassName;
1314

14-
class GetMockBuilderDynamicReturnTypeExtension implements \PHPStan\Type\DynamicMethodReturnTypeExtension
15+
class GetMockBuilderDynamicReturnTypeExtension implements DynamicMethodReturnTypeExtension
1516
{
1617

1718
public function getClass(): string
@@ -43,7 +44,7 @@ public function getTypeFromMethodCall(MethodReflection $methodReflection, Method
4344
}
4445

4546
if ($argType instanceof ConstantArrayType) {
46-
$classes = array_map(function (Type $argType): string {
47+
$classes = array_map(function (ConstantStringType $argType): string {
4748
return $argType->getValue();
4849
}, $argType->getValueTypes());
4950

Diff for: src/Type/PHPUnit/MockBuilderDynamicReturnTypeExtension.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,16 @@
55
use PhpParser\Node\Expr\MethodCall;
66
use PHPStan\Analyser\Scope;
77
use PHPStan\Broker\Broker;
8+
use PHPStan\Reflection\BrokerAwareExtension;
89
use PHPStan\Reflection\MethodReflection;
910
use PHPStan\Reflection\ParametersAcceptorSelector;
11+
use PHPStan\Type\DynamicMethodReturnTypeExtension;
1012
use PHPStan\Type\ObjectType;
1113
use PHPStan\Type\Type;
1214
use PHPStan\Type\TypeCombinator;
1315
use PHPStan\Type\TypeWithClassName;
1416

15-
class MockBuilderDynamicReturnTypeExtension implements \PHPStan\Type\DynamicMethodReturnTypeExtension, \PHPStan\Reflection\BrokerAwareExtension
17+
class MockBuilderDynamicReturnTypeExtension implements DynamicMethodReturnTypeExtension, BrokerAwareExtension
1618
{
1719

1820
/** @var \PHPStan\Broker\Broker */

Diff for: src/Type/PHPUnit/MockBuilderType.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22

33
namespace PHPStan\Type\PHPUnit;
44

5+
use PHPStan\Type\ObjectType;
56
use PHPStan\Type\TypeWithClassName;
67
use PHPStan\Type\VerbosityLevel;
78

8-
class MockBuilderType extends \PHPStan\Type\ObjectType
9+
class MockBuilderType extends ObjectType
910
{
1011

1112
/** @var array<string> */

Diff for: tests/Type/PHPUnit/CreateMockExtensionTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public function testCreateMock(string $expression, string $type): void
2121
__DIR__ . '/data/create-mock.php',
2222
$expression,
2323
$type,
24-
[new CreateMockDynamicReturnTypeExtension(), new GetMockBuilderDynamicReturnTypeExtension()]
24+
[new CreateMockDynamicReturnTypeExtension()]
2525
);
2626
}
2727

Diff for: tests/Type/PHPUnit/ExtensionTestCase.php

+6
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@
2020
abstract class ExtensionTestCase extends TestCase
2121
{
2222

23+
/**
24+
* @param string $file
25+
* @param string $expression
26+
* @param string $type
27+
* @param array<DynamicMethodReturnTypeExtension> $extensions
28+
*/
2329
protected function processFile(
2430
string $file,
2531
string $expression,

0 commit comments

Comments
 (0)