diff --git a/.travis.yml b/.travis.yml index 4595318a..5edc6097 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,5 @@ language: php php: - - 7.0 - 7.1 - 7.2 before_script: diff --git a/composer.json b/composer.json index df733a1b..9881aaac 100644 --- a/composer.json +++ b/composer.json @@ -6,12 +6,12 @@ "prefer-stable": true, "extra": { "branch-alias": { - "dev-master": "0.9-dev" + "dev-master": "0.10-dev" } }, "require": { - "php": "~7.0", - "phpstan/phpstan": "^0.9", + "php": "~7.1", + "phpstan/phpstan": "^0.10", "doctrine/common": "^2.7", "doctrine/orm": "^2.5" }, @@ -19,9 +19,9 @@ "consistence/coding-standard": "~0.13.0", "jakub-onderka/php-parallel-lint": "^0.9.2", "phing/phing": "^2.16.0", - "phpstan/phpstan-phpunit": "^0.9", - "phpstan/phpstan-strict-rules": "^0.9", - "phpunit/phpunit": "^6.4", + "phpstan/phpstan-phpunit": "^0.10", + "phpstan/phpstan-strict-rules": "^0.10", + "phpunit/phpunit": "^7.0", "slevomat/coding-standard": "^2.0" }, "autoload": { diff --git a/src/Reflection/Doctrine/DoctrineSelectableClassReflectionExtension.php b/src/Reflection/Doctrine/DoctrineSelectableClassReflectionExtension.php index d08ecca8..df79842f 100644 --- a/src/Reflection/Doctrine/DoctrineSelectableClassReflectionExtension.php +++ b/src/Reflection/Doctrine/DoctrineSelectableClassReflectionExtension.php @@ -8,7 +8,7 @@ class DoctrineSelectableClassReflectionExtension implements \PHPStan\Reflection\ /** @var \PHPStan\Broker\Broker */ private $broker; - public function setBroker(\PHPStan\Broker\Broker $broker) + public function setBroker(\PHPStan\Broker\Broker $broker): void { $this->broker = $broker; } diff --git a/tests/PHPStan/Reflection/Doctrine/DoctrineSelectableClassReflectionExtensionTest.php b/tests/PHPStan/Reflection/Doctrine/DoctrineSelectableClassReflectionExtensionTest.php index 0e47d72d..cb162c6b 100644 --- a/tests/PHPStan/Reflection/Doctrine/DoctrineSelectableClassReflectionExtensionTest.php +++ b/tests/PHPStan/Reflection/Doctrine/DoctrineSelectableClassReflectionExtensionTest.php @@ -13,7 +13,7 @@ final class DoctrineSelectableClassReflectionExtensionTest extends \PHPStan\Test /** @var \PHPStan\Reflection\Doctrine\DoctrineSelectableClassReflectionExtension */ private $extension; - protected function setUp() + protected function setUp(): void { $this->broker = $this->createBroker(); @@ -38,17 +38,17 @@ public function dataHasMethod(): array * @param string $method * @param bool $expectedResult */ - public function testHasMethod(string $className, string $method, bool $expectedResult) + public function testHasMethod(string $className, string $method, bool $expectedResult): void { $classReflection = $this->broker->getClass($className); - $this->assertSame($expectedResult, $this->extension->hasMethod($classReflection, $method)); + self::assertSame($expectedResult, $this->extension->hasMethod($classReflection, $method)); } - public function testGetMethod() + public function testGetMethod(): void { $classReflection = $this->broker->getClass(\Doctrine\Common\Collections\Collection::class); $methodReflection = $this->extension->getMethod($classReflection, 'matching'); - $this->assertSame('matching', $methodReflection->getName()); + self::assertSame('matching', $methodReflection->getName()); } } diff --git a/tests/PHPStan/Type/Doctrine/DoctrineSelectableDynamicReturnTypeExtensionTest.php b/tests/PHPStan/Type/Doctrine/DoctrineSelectableDynamicReturnTypeExtensionTest.php index 016cc656..6800d5f3 100644 --- a/tests/PHPStan/Type/Doctrine/DoctrineSelectableDynamicReturnTypeExtensionTest.php +++ b/tests/PHPStan/Type/Doctrine/DoctrineSelectableDynamicReturnTypeExtensionTest.php @@ -17,7 +17,7 @@ final class DoctrineSelectableDynamicReturnTypeExtensionTest extends TestCase /** @var \PHPStan\Type\Doctrine\DoctrineSelectableDynamicReturnTypeExtension */ private $extension; - protected function setUp() + protected function setUp(): void { $this->extension = new DoctrineSelectableDynamicReturnTypeExtension(); } @@ -39,14 +39,14 @@ public function dataIsMethodSupported(): array * @param string $method * @param bool $expectedResult */ - public function testIsMethodSupported(string $method, bool $expectedResult) + public function testIsMethodSupported(string $method, bool $expectedResult): void { $methodReflection = $this->createMock(MethodReflection::class); $methodReflection->method('getName')->willReturn($method); - $this->assertSame($expectedResult, $this->extension->isMethodSupported($methodReflection)); + self::assertSame($expectedResult, $this->extension->isMethodSupported($methodReflection)); } - public function testGetTypeFromMethodCall() + public function testGetTypeFromMethodCall(): void { $methodReflection = $this->createMock(MethodReflection::class); @@ -65,8 +65,8 @@ function (): Type { $resultType = $this->extension->getTypeFromMethodCall($methodReflection, $methodCall, $scope); - $this->assertInstanceOf(ObjectType::class, $resultType); - $this->assertSame(\Doctrine\Common\Collections\Collection::class, $resultType->describe()); + self::assertInstanceOf(ObjectType::class, $resultType); + self::assertSame(\Doctrine\Common\Collections\Collection::class, $resultType->describe()); } } diff --git a/tests/PHPStan/Type/Doctrine/EntityManagerFindDynamicReturnTypeExtensionTest.php b/tests/PHPStan/Type/Doctrine/EntityManagerFindDynamicReturnTypeExtensionTest.php index 7761ed61..c903d19d 100644 --- a/tests/PHPStan/Type/Doctrine/EntityManagerFindDynamicReturnTypeExtensionTest.php +++ b/tests/PHPStan/Type/Doctrine/EntityManagerFindDynamicReturnTypeExtensionTest.php @@ -17,7 +17,7 @@ final class EntityManagerFindDynamicReturnTypeExtensionTest extends TestCase /** @var \PHPStan\Type\Doctrine\EntityManagerFindDynamicReturnTypeExtension */ private $extension; - protected function setUp() + protected function setUp(): void { $this->extension = new EntityManagerFindDynamicReturnTypeExtension(); } @@ -41,11 +41,11 @@ public function dataIsMethodSupported(): array * @param string $method * @param bool $expectedResult */ - public function testIsMethodSupported(string $method, bool $expectedResult) + public function testIsMethodSupported(string $method, bool $expectedResult): void { $methodReflection = $this->createMock(MethodReflection::class); $methodReflection->method('getName')->willReturn($method); - $this->assertSame($expectedResult, $this->extension->isMethodSupported($methodReflection)); + self::assertSame($expectedResult, $this->extension->isMethodSupported($methodReflection)); } /** @@ -112,7 +112,7 @@ public function testGetTypeFromMethodCallWithClassConstFetch( string $entityClassName, string $method, string $expectedTypeDescription - ) + ): void { $methodReflection = $this->mockMethodReflection($method); $scope = $this->mockScope(); @@ -120,7 +120,7 @@ public function testGetTypeFromMethodCallWithClassConstFetch( $resultType = $this->extension->getTypeFromMethodCall($methodReflection, $methodCall, $scope); - $this->assertSame($expectedTypeDescription, $resultType->describe()); + self::assertSame($expectedTypeDescription, $resultType->describe()); } /** @@ -195,7 +195,7 @@ public function testGetTypeFromMethodCallWithScalarString( $resultType = $this->extension->getTypeFromMethodCall($methodReflection, $methodCall, $scope); - $this->assertSame($expectedTypeDescription, $resultType->describe()); + self::assertSame($expectedTypeDescription, $resultType->describe()); } private function mockMethodReflection(string $method): MethodReflection