Skip to content

Commit ffd1f01

Browse files
authored
Dep update (#85)
1 parent 3c61617 commit ffd1f01

8 files changed

Lines changed: 66 additions & 31 deletions

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
DOCKER_PHP_EXEC := docker compose run --rm --env PHP_CS_FIXER_IGNORE_ENV=1 php
1+
DOCKER_PHP_EXEC := docker compose run --rm php
22
PHP_BIN=php -d zend.assertions=1
33

44
all: csfix static-analysis test

composer.json

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,32 +19,32 @@
1919
],
2020
"require": {
2121
"php": "~8.3.0 || ~8.4.0",
22-
"phpstan/phpstan": "^2.1.6"
22+
"phpstan/phpstan": "^2.1.22"
2323
},
2424
"require-dev": {
25-
"laminas/laminas-filter": "^2.40.0",
25+
"laminas/laminas-filter": "^2.41.0",
2626
"laminas/laminas-form": "^3.21.0",
2727
"laminas/laminas-hydrator": "^4.16.0",
28-
"laminas/laminas-i18n": "^2.29.0",
29-
"laminas/laminas-inputfilter": "^2.31.0",
28+
"laminas/laminas-i18n": "^2.30.0",
29+
"laminas/laminas-inputfilter": "^2.33.0",
3030
"laminas/laminas-mvc": "^3.8.0",
3131
"laminas/laminas-paginator": "^2.19.0",
32-
"laminas/laminas-validator": "^2.64.2",
33-
"phpstan/phpstan-deprecation-rules": "^2.0.1",
34-
"phpstan/phpstan-phpunit": "^2.0.4",
35-
"phpunit/phpunit": "^11.5.9",
32+
"laminas/laminas-validator": "^2.64.4",
33+
"phpstan/phpstan-deprecation-rules": "^2.0.3",
34+
"phpstan/phpstan-phpunit": "^2.0.7",
35+
"phpunit/phpunit": "^11.5.28",
3636
"slam/php-cs-fixer-extensions": "^3.12.0"
3737
},
3838
"conflict": {
39-
"laminas/laminas-filter": "<2.37",
40-
"laminas/laminas-form": "<3.20",
41-
"laminas/laminas-hydrator": "<4.15",
42-
"laminas/laminas-i18n": "<2.28",
43-
"laminas/laminas-inputfilter": "<2.30",
39+
"laminas/laminas-filter": "<2.41",
40+
"laminas/laminas-form": "<3.21",
41+
"laminas/laminas-hydrator": "<4.16",
42+
"laminas/laminas-i18n": "<2.30",
43+
"laminas/laminas-inputfilter": "<2.33",
4444
"laminas/laminas-log": "<2.16",
4545
"laminas/laminas-mail": "<2.25",
46-
"laminas/laminas-mvc": "<3.7",
47-
"laminas/laminas-paginator": "<2.18",
46+
"laminas/laminas-mvc": "<3.8",
47+
"laminas/laminas-paginator": "<2.19",
4848
"laminas/laminas-validator": "<2.64"
4949
},
5050
"autoload": {

phpstan-baseline.neon

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,38 @@ parameters:
1212
count: 2
1313
path: src/Type/Laminas/AbstractServiceLocatorGetDynamicReturnTypeExtension.php
1414

15+
-
16+
message: '''
17+
#^Access to constant on deprecated class Laminas\\View\\ViewEvent\:
18+
Since 2\.40\.0\. This class will be removed in 3\.0 without replacement when laminas\-view removes support
19+
for rendering strategies\.$#
20+
'''
21+
identifier: classConstant.deprecatedClass
22+
count: 1
23+
path: src/Type/Laminas/ServiceGetterDynamicReturnTypeExtension/ViewEventGetterDynamicReturnTypeExtension.php
24+
25+
-
26+
message: '''
27+
#^Access to constant on deprecated class Laminas\\View\\View\:
28+
Since 2\.40\.0\. This class will be removed in 3\.0 when laminas\-view removes support for rendering
29+
strategies\. It is possible that Laminas\\View\\View will be re\-introduced as a class with the sole
30+
purpose of implementing the 2\-step view via a `render` method, however all other functionality will be
31+
removed entirely\.$#
32+
'''
33+
identifier: classConstant.deprecatedClass
34+
count: 1
35+
path: src/Type/Laminas/ServiceGetterDynamicReturnTypeExtension/ViewGetterDynamicReturnTypeExtension.php
36+
37+
-
38+
message: '''
39+
#^Access to constant on deprecated class Laminas\\View\\Helper\\AbstractHelper\:
40+
Since 2\.40\.0\. This class will be remove in 3\.0 without replacement\. View helpers should be constructed
41+
with their dependencies, therefore the setters and getters here become irrelevant\.$#
42+
'''
43+
identifier: classConstant.deprecatedClass
44+
count: 1
45+
path: src/Type/Laminas/ServiceGetterDynamicReturnTypeExtension/ViewHelperGetterDynamicReturnTypeExtension.php
46+
1547
-
1648
message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertInstanceOf\(\) with ''LaminasPhpStan\\\\TestAsset\\\\BarService'' and Laminas\\Stdlib\\DispatchableInterface will always evaluate to false\.$#'
1749
identifier: staticMethod.impossibleType

src/Type/Laminas/ControllerPluginClassReflectionExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public function __construct(
2222

2323
public function hasMethod(ClassReflection $classReflection, string $methodName): bool
2424
{
25-
return $classReflection->isSubclassOf(AbstractController::class) && $this->getControllerPluginManager()->has($methodName);
25+
return $classReflection->isSubclassOfClass($this->reflectionProvider->getClass(AbstractController::class)) && $this->getControllerPluginManager()->has($methodName);
2626
}
2727

2828
public function getMethod(ClassReflection $classReflection, string $methodName): MethodReflection

src/Type/Laminas/StdlibAbstractOptionsPropertiesClassReflectionExtension.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,19 @@
88
use PHPStan\Reflection\ClassReflection;
99
use PHPStan\Reflection\PropertiesClassReflectionExtension;
1010
use PHPStan\Reflection\PropertyReflection;
11+
use PHPStan\Reflection\ReflectionProvider;
1112
use PHPStan\TrinaryLogic;
1213
use PHPStan\Type\Type;
1314

1415
final class StdlibAbstractOptionsPropertiesClassReflectionExtension implements PropertiesClassReflectionExtension
1516
{
17+
public function __construct(
18+
private ReflectionProvider $reflectionProvider,
19+
) {}
20+
1621
public function hasProperty(ClassReflection $classReflection, string $propertyName): bool
1722
{
18-
return $classReflection->isSubclassOf(AbstractOptions::class) && $classReflection->hasNativeMethod($this->getGetterName($propertyName));
23+
return $classReflection->isSubclassOfClass($this->reflectionProvider->getClass(AbstractOptions::class)) && $classReflection->hasNativeMethod($this->getGetterName($propertyName));
1924
}
2025

2126
public function getProperty(ClassReflection $classReflection, string $propertyName): PropertyReflection
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[
22
{
33
"message": "The service \"foobar\" was not configured in Laminas\\View\\HelperPluginManager nor the class \"foobar\" exists.",
4-
"line": 24,
4+
"line": 22,
55
"ignorable": true
66
}
77
]

tests/LaminasIntegration/data/viewHelperPluginMethod.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,11 @@
55
namespace LaminasPhpStan\Tests\LaminasIntegration\data;
66

77
use Laminas\ServiceManager\ServiceManager;
8-
use Laminas\View\Helper\HelperInterface;
98
use Laminas\View\HelperPluginManager;
109
use LaminasPhpStan\TestAsset\CustomViewHelperPlugin;
1110

1211
final class viewHelperPluginMethod
1312
{
14-
/** @var HelperPluginManager<HelperInterface> */
1513
private HelperPluginManager $viewHelperManager;
1614

1715
public function __construct(ServiceManager $serviceManager)

tests/Rules/Laminas/ServiceManagerGetMethodCallRuleTest.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,6 @@ protected function setUp(): void
2828
$this->serviceManagerLoader = new ServiceManagerLoader(\dirname(__DIR__, 2) . '/LaminasIntegration/servicemanagerloader.php');
2929
}
3030

31-
/** @return string[][] */
32-
public static function provideRuleCases(): iterable
33-
{
34-
return [
35-
'ServiceManager' => ['ServiceManagerFoo.php', ServiceManager::class],
36-
'Interop container' => ['InteropContainerFoo.php', InteropContainerInterface::class],
37-
'PSR container' => ['PsrContainerFoo.php', PsrContainerInterface::class],
38-
];
39-
}
40-
4131
/** @return Rule<MethodCall> */
4232
protected function getRule(): Rule
4333
{
@@ -54,4 +44,14 @@ public function testRule(string $filename, string $containerClassname): void
5444
],
5545
]);
5646
}
47+
48+
/** @return string[][] */
49+
public static function provideRuleCases(): iterable
50+
{
51+
return [
52+
'ServiceManager' => ['ServiceManagerFoo.php', ServiceManager::class],
53+
'Interop container' => ['InteropContainerFoo.php', InteropContainerInterface::class],
54+
'PSR container' => ['PsrContainerFoo.php', PsrContainerInterface::class],
55+
];
56+
}
5757
}

0 commit comments

Comments
 (0)