Skip to content

Commit e03752e

Browse files
Majkl578ondrejmirtes
authored andcommitted
Compatibility with PHPStan 0.10
1 parent c1f3523 commit e03752e

File tree

6 files changed

+24
-25
lines changed

6 files changed

+24
-25
lines changed

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
language: php
22
php:
3-
- 7.0
43
- 7.1
54
- 7.2
65
before_script:

composer.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,22 @@
66
"prefer-stable": true,
77
"extra": {
88
"branch-alias": {
9-
"dev-master": "0.9-dev"
9+
"dev-master": "0.10-dev"
1010
}
1111
},
1212
"require": {
13-
"php": "~7.0",
14-
"phpstan/phpstan": "^0.9",
13+
"php": "~7.1",
14+
"phpstan/phpstan": "^0.10",
1515
"doctrine/common": "^2.7",
1616
"doctrine/orm": "^2.5"
1717
},
1818
"require-dev": {
1919
"consistence/coding-standard": "~0.13.0",
2020
"jakub-onderka/php-parallel-lint": "^0.9.2",
2121
"phing/phing": "^2.16.0",
22-
"phpstan/phpstan-phpunit": "^0.9",
23-
"phpstan/phpstan-strict-rules": "^0.9",
24-
"phpunit/phpunit": "^6.4",
22+
"phpstan/phpstan-phpunit": "^0.10",
23+
"phpstan/phpstan-strict-rules": "^0.10",
24+
"phpunit/phpunit": "^7.0",
2525
"slevomat/coding-standard": "^2.0"
2626
},
2727
"autoload": {

src/Reflection/Doctrine/DoctrineSelectableClassReflectionExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class DoctrineSelectableClassReflectionExtension implements \PHPStan\Reflection\
88
/** @var \PHPStan\Broker\Broker */
99
private $broker;
1010

11-
public function setBroker(\PHPStan\Broker\Broker $broker)
11+
public function setBroker(\PHPStan\Broker\Broker $broker): void
1212
{
1313
$this->broker = $broker;
1414
}

tests/PHPStan/Reflection/Doctrine/DoctrineSelectableClassReflectionExtensionTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ final class DoctrineSelectableClassReflectionExtensionTest extends \PHPStan\Test
1313
/** @var \PHPStan\Reflection\Doctrine\DoctrineSelectableClassReflectionExtension */
1414
private $extension;
1515

16-
protected function setUp()
16+
protected function setUp(): void
1717
{
1818
$this->broker = $this->createBroker();
1919

@@ -38,17 +38,17 @@ public function dataHasMethod(): array
3838
* @param string $method
3939
* @param bool $expectedResult
4040
*/
41-
public function testHasMethod(string $className, string $method, bool $expectedResult)
41+
public function testHasMethod(string $className, string $method, bool $expectedResult): void
4242
{
4343
$classReflection = $this->broker->getClass($className);
44-
$this->assertSame($expectedResult, $this->extension->hasMethod($classReflection, $method));
44+
self::assertSame($expectedResult, $this->extension->hasMethod($classReflection, $method));
4545
}
4646

47-
public function testGetMethod()
47+
public function testGetMethod(): void
4848
{
4949
$classReflection = $this->broker->getClass(\Doctrine\Common\Collections\Collection::class);
5050
$methodReflection = $this->extension->getMethod($classReflection, 'matching');
51-
$this->assertSame('matching', $methodReflection->getName());
51+
self::assertSame('matching', $methodReflection->getName());
5252
}
5353

5454
}

tests/PHPStan/Type/Doctrine/DoctrineSelectableDynamicReturnTypeExtensionTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ final class DoctrineSelectableDynamicReturnTypeExtensionTest extends TestCase
1717
/** @var \PHPStan\Type\Doctrine\DoctrineSelectableDynamicReturnTypeExtension */
1818
private $extension;
1919

20-
protected function setUp()
20+
protected function setUp(): void
2121
{
2222
$this->extension = new DoctrineSelectableDynamicReturnTypeExtension();
2323
}
@@ -39,14 +39,14 @@ public function dataIsMethodSupported(): array
3939
* @param string $method
4040
* @param bool $expectedResult
4141
*/
42-
public function testIsMethodSupported(string $method, bool $expectedResult)
42+
public function testIsMethodSupported(string $method, bool $expectedResult): void
4343
{
4444
$methodReflection = $this->createMock(MethodReflection::class);
4545
$methodReflection->method('getName')->willReturn($method);
46-
$this->assertSame($expectedResult, $this->extension->isMethodSupported($methodReflection));
46+
self::assertSame($expectedResult, $this->extension->isMethodSupported($methodReflection));
4747
}
4848

49-
public function testGetTypeFromMethodCall()
49+
public function testGetTypeFromMethodCall(): void
5050
{
5151
$methodReflection = $this->createMock(MethodReflection::class);
5252

@@ -65,8 +65,8 @@ function (): Type {
6565

6666
$resultType = $this->extension->getTypeFromMethodCall($methodReflection, $methodCall, $scope);
6767

68-
$this->assertInstanceOf(ObjectType::class, $resultType);
69-
$this->assertSame(\Doctrine\Common\Collections\Collection::class, $resultType->describe());
68+
self::assertInstanceOf(ObjectType::class, $resultType);
69+
self::assertSame(\Doctrine\Common\Collections\Collection::class, $resultType->describe());
7070
}
7171

7272
}

tests/PHPStan/Type/Doctrine/EntityManagerFindDynamicReturnTypeExtensionTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ final class EntityManagerFindDynamicReturnTypeExtensionTest extends TestCase
1717
/** @var \PHPStan\Type\Doctrine\EntityManagerFindDynamicReturnTypeExtension */
1818
private $extension;
1919

20-
protected function setUp()
20+
protected function setUp(): void
2121
{
2222
$this->extension = new EntityManagerFindDynamicReturnTypeExtension();
2323
}
@@ -41,11 +41,11 @@ public function dataIsMethodSupported(): array
4141
* @param string $method
4242
* @param bool $expectedResult
4343
*/
44-
public function testIsMethodSupported(string $method, bool $expectedResult)
44+
public function testIsMethodSupported(string $method, bool $expectedResult): void
4545
{
4646
$methodReflection = $this->createMock(MethodReflection::class);
4747
$methodReflection->method('getName')->willReturn($method);
48-
$this->assertSame($expectedResult, $this->extension->isMethodSupported($methodReflection));
48+
self::assertSame($expectedResult, $this->extension->isMethodSupported($methodReflection));
4949
}
5050

5151
/**
@@ -112,15 +112,15 @@ public function testGetTypeFromMethodCallWithClassConstFetch(
112112
string $entityClassName,
113113
string $method,
114114
string $expectedTypeDescription
115-
)
115+
): void
116116
{
117117
$methodReflection = $this->mockMethodReflection($method);
118118
$scope = $this->mockScope();
119119
$methodCall = $this->mockMethodCallWithClassConstFetch($entityClassName);
120120

121121
$resultType = $this->extension->getTypeFromMethodCall($methodReflection, $methodCall, $scope);
122122

123-
$this->assertSame($expectedTypeDescription, $resultType->describe());
123+
self::assertSame($expectedTypeDescription, $resultType->describe());
124124
}
125125

126126
/**
@@ -195,7 +195,7 @@ public function testGetTypeFromMethodCallWithScalarString(
195195

196196
$resultType = $this->extension->getTypeFromMethodCall($methodReflection, $methodCall, $scope);
197197

198-
$this->assertSame($expectedTypeDescription, $resultType->describe());
198+
self::assertSame($expectedTypeDescription, $resultType->describe());
199199
}
200200

201201
private function mockMethodReflection(string $method): MethodReflection

0 commit comments

Comments
 (0)