Skip to content

Commit 07ddbb5

Browse files
committed
Update build-cs
1 parent d1f1d46 commit 07ddbb5

7 files changed

+13
-26
lines changed

.github/workflows/build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
with:
5757
repository: "phpstan/build-cs"
5858
path: "build-cs"
59-
ref: "1.x"
59+
ref: "2.x"
6060

6161
- name: "Install PHP"
6262
uses: "shivammathur/setup-php@v2"

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ lint:
1313
.PHONY: cs-install
1414
cs-install:
1515
git clone https://github.com/phpstan/build-cs.git || true
16-
git -C build-cs fetch origin && git -C build-cs reset --hard origin/1.x
16+
git -C build-cs fetch origin && git -C build-cs reset --hard origin/2.x
1717
composer install --working-dir build-cs
1818

1919
.PHONY: cs

src/Mockery/PhpDoc/TypeNodeResolverExtension.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414
class TypeNodeResolverExtension implements \PHPStan\PhpDoc\TypeNodeResolverExtension, TypeNodeResolverAwareExtension
1515
{
1616

17-
/** @var TypeNodeResolver */
18-
private $typeNodeResolver;
17+
private TypeNodeResolver $typeNodeResolver;
1918

2019
public function setTypeNodeResolver(TypeNodeResolver $typeNodeResolver): void
2120
{

src/Mockery/Reflection/StubMethodReflection.php

+3-5
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,9 @@
1515
class StubMethodReflection implements MethodReflection
1616
{
1717

18-
/** @var ClassReflection */
19-
private $declaringClass;
18+
private ClassReflection $declaringClass;
2019

21-
/** @var string */
22-
private $name;
20+
private string $name;
2321

2422
public function __construct(ClassReflection $declaringClass, string $name)
2523
{
@@ -68,7 +66,7 @@ public function getVariants(): array
6866
TemplateTypeMap::createEmpty(),
6967
[],
7068
true,
71-
new ObjectType('Mockery\\Expectation')
69+
new ObjectType('Mockery\\Expectation'),
7270
),
7371
];
7472
}

src/Mockery/Reflection/StubMethodsClassReflectionExtension.php

+2-4
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,9 @@
1111
class StubMethodsClassReflectionExtension implements MethodsClassReflectionExtension
1212
{
1313

14-
/** @var ReflectionProvider */
15-
private $reflectionProvider;
14+
private ReflectionProvider $reflectionProvider;
1615

17-
/** @var string */
18-
private $stubInterfaceName;
16+
private string $stubInterfaceName;
1917

2018
public function __construct(ReflectionProvider $reflectionProvider, string $stubInterfaceName)
2119
{

src/Mockery/Type/StubDynamicReturnTypeExtension.php

+3-7
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,9 @@
1515
class StubDynamicReturnTypeExtension implements DynamicMethodReturnTypeExtension
1616
{
1717

18-
/** @var string */
19-
private $stubInterfaceName;
18+
private string $stubInterfaceName;
2019

21-
/** @var string */
22-
private $stubMethodName;
20+
private string $stubMethodName;
2321

2422
public function __construct(string $stubInterfaceName, string $stubMethodName)
2523
{
@@ -40,9 +38,7 @@ public function isMethodSupported(MethodReflection $methodReflection): bool
4038
public function getTypeFromMethodCall(MethodReflection $methodReflection, MethodCall $methodCall, Scope $scope): ?Type
4139
{
4240
$calledOnType = $scope->getType($methodCall->var)->getObjectClassNames();
43-
$names = array_values(array_filter($calledOnType, static function (string $name) {
44-
return $name !== 'Mockery\\MockInterface';
45-
}));
41+
$names = array_values(array_filter($calledOnType, static fn (string $name) => $name !== 'Mockery\\MockInterface'));
4642
if (count($names) !== 1) {
4743
return null;
4844
}

tests/Mockery/MockeryBarTest.php

+2-6
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,7 @@ public function testShouldNotHaveReceived(): void
6060
$this->fooSpy->shouldNotHaveReceived(null)->withArgs(['bar']);
6161
$this->fooSpy->doBar('ccc');
6262
$this->fooSpy->shouldNotHaveReceived('doBar', ['ddd']);
63-
$this->fooSpy->shouldNotHaveReceived('doBar', static function (string $arg): bool {
64-
return $arg !== 'ccc';
65-
});
63+
$this->fooSpy->shouldNotHaveReceived('doBar', static fn (string $arg): bool => $arg !== 'ccc');
6664
}
6765

6866
public function testShouldHaveReceived(): void
@@ -72,9 +70,7 @@ public function testShouldHaveReceived(): void
7270
$this->fooSpy->shouldHaveReceived('doFoo')->once();
7371
$this->fooSpy->doBar('ccc');
7472
$this->fooSpy->shouldHaveReceived('doBar', ['ccc']);
75-
$this->fooSpy->shouldHaveReceived('doBar', static function (string $arg): bool {
76-
return $arg === 'ccc';
77-
});
73+
$this->fooSpy->shouldHaveReceived('doBar', static fn (string $arg): bool => $arg === 'ccc');
7874
}
7975

8076
}

0 commit comments

Comments
 (0)