Skip to content

Commit 5b36e61

Browse files
committed
Remove support for PHPStan 0.12.x
Upgrade to PHPStan 1.1 as minimum Composer requirement.
1 parent 02712e0 commit 5b36e61

6 files changed

+47
-40
lines changed

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"require": {
1818
"php": "^7.2.0",
1919
"nette/neon": "^3.3.1",
20-
"phpstan/phpstan": "^0.12.23"
20+
"phpstan/phpstan": "^1.1.0"
2121
},
2222
"conflict": {
2323
"magento/framework": "<101.0.0"
@@ -30,8 +30,8 @@
3030
"mikey179/vfsstream": "^1.6.10",
3131
"nikic/php-parser": "^4.13.1",
3232
"phpstan/extension-installer": "^1.1.0",
33-
"phpstan/phpstan-phpunit": "^0.12.22",
34-
"phpstan/phpstan-strict-rules": "^0.12.11",
33+
"phpstan/phpstan-phpunit": "^1.0.0",
34+
"phpstan/phpstan-strict-rules": "^1.0.0",
3535
"phpunit/phpunit": "^9.5.10",
3636
"roave/security-advisories": "dev-latest",
3737
"squizlabs/php_codesniffer": "^3.6.1"

composer.lock

Lines changed: 28 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/bitExpert/PHPStan/Magento/Rules/GetCollectionMockMethodNeedsCollectionSubclassRuleUnitTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ protected function getRule(): Rule
3131
return new GetCollectionMockMethodNeedsCollectionSubclassRule();
3232
}
3333

34-
/**
35-
* @return \PHPStan\Type\DynamicMethodReturnTypeExtension[]
36-
*/
37-
public function getDynamicMethodReturnTypeExtensions() : array
34+
public static function getAdditionalConfigFiles(): array
3835
{
39-
return [
40-
new TestFrameworkObjectManagerDynamicReturnTypeExtension(),
41-
];
36+
// make sure to load \bitExpert\PHPStan\Magento\Type\TestFrameworkObjectManagerDynamicReturnTypeExtension
37+
// which is needed for the integration test
38+
return array_merge(
39+
parent::getAdditionalConfigFiles(),
40+
[__DIR__ . '/Helper/dynamic_method_returntype_extension.neon']
41+
);
4242
}
4343

4444
/**
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
services:
2+
-
3+
class: bitExpert\PHPStan\Magento\Type\TestFrameworkObjectManagerDynamicReturnTypeExtension
4+
tags:
5+
- phpstan.broker.dynamicMethodReturnTypeExtension

tests/bitExpert/PHPStan/Magento/Type/ObjectManagerDynamicReturnTypeExtensionUnitTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
use PhpParser\Node\Expr\MethodCall;
1616
use PHPStan\Analyser\Scope;
1717
use PHPStan\Reflection\MethodReflection;
18-
use PHPStan\Testing\TestCase;
18+
use PHPStan\Testing\PHPStanTestCase;
1919
use PHPStan\Type\MixedType;
2020

21-
class ObjectManagerDynamicReturnTypeExtensionUnitTest extends TestCase
21+
class ObjectManagerDynamicReturnTypeExtensionUnitTest extends PHPStanTestCase
2222
{
2323
/**
2424
* @var ObjectManagerDynamicReturnTypeExtension

tests/bitExpert/PHPStan/Magento/Type/TestFrameworkObjectManagerDynamicReturnTypeExtensionUnitTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
use PHPStan\Analyser\Scope;
2121
use PHPStan\Reflection\MethodReflection;
2222
use PHPStan\ShouldNotHappenException;
23-
use PHPStan\Testing\TestCase;
23+
use PHPStan\Testing\PHPStanTestCase;
2424
use PHPStan\Type\ArrayType;
2525
use PHPStan\Type\Constant\ConstantStringType;
2626
use PHPStan\Type\ErrorType;
@@ -31,7 +31,7 @@
3131
use PHPStan\Type\StringType;
3232
use PHPStan\Type\UnionType;
3333

34-
class TestFrameworkObjectManagerDynamicReturnTypeExtensionUnitTest extends TestCase
34+
class TestFrameworkObjectManagerDynamicReturnTypeExtensionUnitTest extends PHPStanTestCase
3535
{
3636
/**
3737
* @var TestFrameworkObjectManagerDynamicReturnTypeExtension

0 commit comments

Comments
 (0)