Skip to content

Commit 34c1ea5

Browse files
authored
Merge pull request #326 from bitExpert/dependabot/composer/phpstan/phpstan-approx-1.12.0
Update phpstan/phpstan requirement from ~1.11.1 to ~1.12.0
2 parents 4190f43 + 6b7e7cf commit 34c1ea5

File tree

4 files changed

+32
-20
lines changed

4 files changed

+32
-20
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ PHP: PHP 7.2 or higher
1414

1515
Magento: Magento 2.3.0 or higher
1616

17-
PHPStan: PHPStan 1.11
17+
PHPStan: PHPStan 1.12
1818

1919
If you are using a Magento version that requires an older version of PHPStan (e.g. 0.12.77), you need to manually upgrade it before
20-
installing this extension. in your composer.json Change the PHPStan version to `~1.11` and run:
20+
installing this extension. in your composer.json Change the PHPStan version to `~1.12` and run:
2121

2222
```
2323
composer update phpstan/phpstan --with-all-dependencies

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"php": "^7.2.0 || ^8.1.0",
2424
"ext-dom": "*",
2525
"laminas/laminas-code": "~3.3.0 || ~3.4.1 || ~3.5.1 || ^4.5 || ^4.10",
26-
"phpstan/phpstan": "~1.11.1",
26+
"phpstan/phpstan": "~1.12.0",
2727
"symfony/finder": "^3.0 || ^4.0 || ^5.0 || ^6.0"
2828
},
2929
"conflict": {

tests/bitExpert/PHPStan/Magento/Autoload/ExtensionAutoloaderUnitTest.php

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,25 @@
77
use bitExpert\PHPStan\Magento\Autoload\DataProvider\ExtensionAttributeDataProvider;
88
use org\bovigo\vfs\vfsStream;
99
use PHPStan\Cache\Cache;
10+
use PHPStan\Cache\CacheStorage;
1011
use PHPUnit\Framework\TestCase;
1112

1213
class ExtensionAutoloaderUnitTest extends TestCase
1314
{
1415
/**
15-
* @var Cache|\PHPUnit\Framework\MockObject\MockObject
16+
* @var Cache
1617
*/
1718
private $cache;
1819
/**
19-
* @var ClassLoaderProvider|\PHPUnit\Framework\MockObject\MockObject
20+
* @var CacheStorage&\PHPUnit\Framework\MockObject\MockObject
21+
*/
22+
private $cacheStorage;
23+
/**
24+
* @var ClassLoaderProvider&\PHPUnit\Framework\MockObject\MockObject
2025
*/
2126
private $classLoader;
2227
/**
23-
* @var ExtensionAttributeDataProvider|\PHPUnit\Framework\MockObject\MockObject
28+
* @var ExtensionAttributeDataProvider&\PHPUnit\Framework\MockObject\MockObject
2429
*/
2530
private $extAttrDataProvider;
2631
/**
@@ -30,7 +35,8 @@ class ExtensionAutoloaderUnitTest extends TestCase
3035

3136
protected function setUp(): void
3237
{
33-
$this->cache = $this->createMock(Cache::class);
38+
$this->cacheStorage = $this->createMock(CacheStorage::class);
39+
$this->cache = new Cache($this->cacheStorage);
3440
$this->classLoader = $this->createMock(ClassLoaderProvider::class);
3541
$this->extAttrDataProvider = $this->createMock(ExtensionAttributeDataProvider::class);
3642
$this->autoloader = new ExtensionAutoloader(
@@ -47,7 +53,7 @@ public function autoloaderIgnoresClassesWithoutExtensionInterfacePostfix(): void
4753
{
4854
$this->classLoader->expects(self::never())
4955
->method('findFile');
50-
$this->cache->expects(self::never())
56+
$this->cacheStorage->expects(self::never())
5157
->method('load');
5258

5359
$this->autoloader->autoload('SomeClass');
@@ -61,7 +67,7 @@ public function autoloaderPrefersLocalFile(): void
6167
$this->classLoader->expects(self::once())
6268
->method('findFile')
6369
->willReturn(__DIR__ . '/HelperExtension.php');
64-
$this->cache->expects(self::never())
70+
$this->cacheStorage->expects(self::never())
6571
->method('load');
6672

6773
$this->autoloader->autoload(HelperExtension::class);
@@ -77,11 +83,11 @@ public function autoloaderUsesCachedFileWhenFound(): void
7783
$this->classLoader->expects(self::once())
7884
->method('findFile')
7985
->willReturn(false);
80-
$this->cache->expects(self::once())
86+
$this->cacheStorage->expects(self::once())
8187
->method('load')
8288
->willReturn(__DIR__ . '/HelperExtension.php');
8389

84-
$this->cache->expects(self::never())
90+
$this->cacheStorage->expects(self::never())
8591
->method('save');
8692

8793
$this->autoloader->autoload(HelperExtension::class);

tests/bitExpert/PHPStan/Magento/Autoload/ExtensionInterfaceAutoloaderUnitTest.php

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,25 @@
88
use InvalidArgumentException;
99
use org\bovigo\vfs\vfsStream;
1010
use PHPStan\Cache\Cache;
11+
use PHPStan\Cache\CacheStorage;
1112
use PHPUnit\Framework\TestCase;
1213

1314
class ExtensionInterfaceAutoloaderUnitTest extends TestCase
1415
{
1516
/**
16-
* @var Cache|\PHPUnit\Framework\MockObject\MockObject
17+
* @var Cache
1718
*/
1819
private $cache;
1920
/**
20-
* @var ExtensionAttributeDataProvider|\PHPUnit\Framework\MockObject\MockObject
21+
* @var CacheStorage&\PHPUnit\Framework\MockObject\MockObject
22+
*/
23+
private $cacheStorage;
24+
/**
25+
* @var ExtensionAttributeDataProvider&\PHPUnit\Framework\MockObject\MockObject
2126
*/
2227
private $extAttrDataProvider;
2328
/**
24-
* @var ClassLoaderProvider|\PHPUnit\Framework\MockObject\MockObject
29+
* @var ClassLoaderProvider&\PHPUnit\Framework\MockObject\MockObject
2530
*/
2631
private $classLoader;
2732
/**
@@ -31,7 +36,8 @@ class ExtensionInterfaceAutoloaderUnitTest extends TestCase
3136

3237
protected function setUp(): void
3338
{
34-
$this->cache = $this->createMock(Cache::class);
39+
$this->cacheStorage = $this->createMock(CacheStorage::class);
40+
$this->cache = new Cache($this->cacheStorage);
3541
$this->classLoader = $this->createMock(ClassLoaderProvider::class);
3642
$this->extAttrDataProvider = $this->createMock(ExtensionAttributeDataProvider::class);
3743
$this->autoloader = new ExtensionInterfaceAutoloader(
@@ -48,7 +54,7 @@ public function autoloaderIgnoresClassesWithoutExtensionInterfacePostfix(): void
4854
{
4955
$this->classLoader->expects(self::never())
5056
->method('findFile');
51-
$this->cache->expects(self::never())
57+
$this->cacheStorage->expects(self::never())
5258
->method('load');
5359

5460
$this->autoloader->autoload('SomeClass');
@@ -62,7 +68,7 @@ public function autoloaderPrefersLocalFile(): void
6268
$this->classLoader->expects(self::once())
6369
->method('findFile')
6470
->willReturn(__DIR__ . '/HelperExtensionInterface.php');
65-
$this->cache->expects(self::never())
71+
$this->cacheStorage->expects(self::never())
6672
->method('load');
6773

6874
$this->autoloader->autoload(HelperExtensionInterface::class);
@@ -78,11 +84,11 @@ public function autoloaderUsesCachedFileWhenFound(): void
7884
$this->classLoader->expects(self::once())
7985
->method('findFile')
8086
->willReturn(false);
81-
$this->cache->expects(self::once())
87+
$this->cacheStorage->expects(self::once())
8288
->method('load')
8389
->willReturn(__DIR__ . '/HelperExtensionInterface.php');
8490

85-
$this->cache->expects(self::never())
91+
$this->cacheStorage->expects(self::never())
8692
->method('save');
8793

8894
$this->autoloader->autoload(HelperExtensionInterface::class);
@@ -103,7 +109,7 @@ public function autoloadDoesNotGenerateInterfaceWhenNoAttributesExist(): void
103109
$this->classLoader->expects(self::once())
104110
->method('findFile')
105111
->willReturn(false);
106-
$this->cache->expects(self::once())
112+
$this->cacheStorage->expects(self::once())
107113
->method('load')
108114
->willReturn(null);
109115

0 commit comments

Comments
 (0)