From e65f72d73ba9d638ca94eca826bf78477d37a7f7 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 8 Jan 2024 12:30:17 +0100 Subject: [PATCH] Update all non-major dependencies (#55) * Update all non-major dependencies | datasource | package | from | to | | ---------- | ------------------------- | ------- | ------- | | packagist | laminas/laminas-filter | 2.33.0 | 2.34.0 | | packagist | laminas/laminas-i18n | 2.25.0 | 2.26.0 | | packagist | laminas/laminas-validator | 2.45.0 | 2.46.0 | | packagist | phpstan/phpstan | 1.10.50 | 1.10.54 | * CS Fix --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Filippo Tessarotto --- composer.json | 8 ++++---- src/Rules/Laminas/ServiceManagerGetMethodCallRule.php | 3 ++- src/ServiceManagerLoader.php | 8 +++++--- ...bstractServiceLocatorGetDynamicReturnTypeExtension.php | 3 ++- .../AbstractPluginMethodDynamicReturnTypeExtension.php | 5 +++-- src/Type/Laminas/PluginMethodReflection.php | 3 ++- ...bAbstractOptionsPropertiesClassReflectionExtension.php | 5 +++-- tests/LaminasIntegration/servicemanagerloader.php | 3 ++- 8 files changed, 23 insertions(+), 15 deletions(-) diff --git a/composer.json b/composer.json index 97cd2a0..50de848 100644 --- a/composer.json +++ b/composer.json @@ -19,20 +19,20 @@ ], "require": { "php": "~8.2.0 || ~8.3.0", - "phpstan/phpstan": "^1.10.50" + "phpstan/phpstan": "^1.10.54" }, "require-dev": { "laminas/laminas-cache": "^3.12.0", "laminas/laminas-cache-storage-adapter-memory": "^2.3.0", - "laminas/laminas-filter": "^2.33.0", + "laminas/laminas-filter": "^2.34.0", "laminas/laminas-form": "^3.17.0", "laminas/laminas-hydrator": "^4.15.0", - "laminas/laminas-i18n": "^2.25.0", + "laminas/laminas-i18n": "^2.26.0", "laminas/laminas-inputfilter": "^2.28.0", "laminas/laminas-mail": "^2.25.1", "laminas/laminas-mvc": "^3.7.0", "laminas/laminas-paginator": "^2.18.0", - "laminas/laminas-validator": "^2.45.0", + "laminas/laminas-validator": "^2.46.0", "phpstan/phpstan-deprecation-rules": "^1.1.4", "phpstan/phpstan-phpunit": "^1.3.15", "phpunit/phpunit": "^9.6.15", diff --git a/src/Rules/Laminas/ServiceManagerGetMethodCallRule.php b/src/Rules/Laminas/ServiceManagerGetMethodCallRule.php index b7bf3e4..69ca0ca 100644 --- a/src/Rules/Laminas/ServiceManagerGetMethodCallRule.php +++ b/src/Rules/Laminas/ServiceManagerGetMethodCallRule.php @@ -11,6 +11,7 @@ use LaminasPhpStan\Type\Laminas\ObjectServiceManagerType; use PhpParser\Node; use PhpParser\Node\Arg; +use PhpParser\Node\Expr\MethodCall; use PHPStan\Analyser\Scope; use PHPStan\Reflection\ReflectionProvider; use PHPStan\Rules\Rule; @@ -35,7 +36,7 @@ public function getNodeType(): string } /** - * @param \PhpParser\Node\Expr\MethodCall $node + * @param MethodCall $node * * @return string[] */ diff --git a/src/ServiceManagerLoader.php b/src/ServiceManagerLoader.php index c1a58dc..0a42872 100644 --- a/src/ServiceManagerLoader.php +++ b/src/ServiceManagerLoader.php @@ -5,10 +5,12 @@ namespace LaminasPhpStan; use Interop\Container\ContainerInterface as InteropContainerInterface; +use Laminas\Cache\ConfigProvider; use Laminas\Mvc\Service\ServiceListenerFactory; use Laminas\Mvc\Service\ServiceManagerConfig; use Laminas\ServiceManager\ServiceLocatorInterface; use Laminas\ServiceManager\ServiceManager; +use PHPStan\ShouldNotHappenException; use Psr\Container\ContainerInterface as PsrContainerInterface; use ReflectionProperty; @@ -18,7 +20,7 @@ final class ServiceManagerLoader /** @var string[] */ private array $knownModules = [ - \Laminas\Cache\ConfigProvider::class, + ConfigProvider::class, \Laminas\Filter\ConfigProvider::class, \Laminas\Form\ConfigProvider::class, \Laminas\Hydrator\ConfigProvider::class, @@ -45,12 +47,12 @@ public function __construct(?string $serviceManagerLoader) } if (! \file_exists($serviceManagerLoader) || ! \is_readable($serviceManagerLoader)) { - throw new \PHPStan\ShouldNotHappenException('Service manager could not be loaded'); + throw new ShouldNotHappenException('Service manager could not be loaded'); } $serviceManager = require $serviceManagerLoader; if (! $serviceManager instanceof ServiceManager) { - throw new \PHPStan\ShouldNotHappenException(\sprintf('Loader "%s" doesn\'t return a ServiceManager instance', $serviceManagerLoader)); + throw new ShouldNotHappenException(\sprintf('Loader "%s" doesn\'t return a ServiceManager instance', $serviceManagerLoader)); } $this->serviceLocator = new UnmappedAliasServiceLocatorProxy($serviceManager); diff --git a/src/Type/Laminas/AbstractServiceLocatorGetDynamicReturnTypeExtension.php b/src/Type/Laminas/AbstractServiceLocatorGetDynamicReturnTypeExtension.php index 6e26aa0..d078e98 100644 --- a/src/Type/Laminas/AbstractServiceLocatorGetDynamicReturnTypeExtension.php +++ b/src/Type/Laminas/AbstractServiceLocatorGetDynamicReturnTypeExtension.php @@ -11,6 +11,7 @@ use PHPStan\Analyser\Scope; use PHPStan\Reflection\MethodReflection; use PHPStan\Reflection\ReflectionProvider; +use PHPStan\ShouldNotHappenException; use PHPStan\Type\DynamicMethodReturnTypeExtension; use PHPStan\Type\MixedType; use PHPStan\Type\NeverType; @@ -49,7 +50,7 @@ final public function getTypeFromMethodCall( $firstArg = $args[0]; if (! $firstArg instanceof Arg) { - throw new \PHPStan\ShouldNotHappenException(\sprintf( + throw new ShouldNotHappenException(\sprintf( 'Argument passed to %s::%s should be a string, %s given', $methodReflection->getDeclaringClass()->getName(), $methodReflection->getName(), diff --git a/src/Type/Laminas/PluginMethodDynamicReturnTypeExtension/AbstractPluginMethodDynamicReturnTypeExtension.php b/src/Type/Laminas/PluginMethodDynamicReturnTypeExtension/AbstractPluginMethodDynamicReturnTypeExtension.php index 0acaa3d..806fa27 100644 --- a/src/Type/Laminas/PluginMethodDynamicReturnTypeExtension/AbstractPluginMethodDynamicReturnTypeExtension.php +++ b/src/Type/Laminas/PluginMethodDynamicReturnTypeExtension/AbstractPluginMethodDynamicReturnTypeExtension.php @@ -10,6 +10,7 @@ use PHPStan\Analyser\Scope; use PHPStan\Reflection\MethodReflection; use PHPStan\Reflection\ParametersAcceptorSelector; +use PHPStan\ShouldNotHappenException; use PHPStan\Type\DynamicMethodReturnTypeExtension; use PHPStan\Type\ObjectType; use PHPStan\Type\Type; @@ -36,7 +37,7 @@ final public function getTypeFromMethodCall( ): Type { $firstArg = $methodCall->getArgs()[0]; if (! $firstArg instanceof Arg) { - throw new \PHPStan\ShouldNotHappenException(\sprintf( + throw new ShouldNotHappenException(\sprintf( 'Argument passed to %s::%s should be a string, %s given', $methodReflection->getDeclaringClass()->getName(), $methodReflection->getName(), @@ -60,7 +61,7 @@ final public function getTypeFromMethodCall( return ParametersAcceptorSelector::selectFromArgs($scope, $methodCall->getArgs(), $methodReflection->getVariants())->getReturnType(); } - throw new \PHPStan\ShouldNotHappenException(\sprintf( + throw new ShouldNotHappenException(\sprintf( 'Argument passed to %s::%s should be a string, %s given', $methodReflection->getDeclaringClass()->getName(), $methodReflection->getName(), diff --git a/src/Type/Laminas/PluginMethodReflection.php b/src/Type/Laminas/PluginMethodReflection.php index cae6f09..675dde1 100644 --- a/src/Type/Laminas/PluginMethodReflection.php +++ b/src/Type/Laminas/PluginMethodReflection.php @@ -11,6 +11,7 @@ use PHPStan\TrinaryLogic; use PHPStan\Type\Generic\TemplateTypeMap; use PHPStan\Type\ObjectType; +use PHPStan\Type\Type; final class PluginMethodReflection implements MethodReflection { @@ -85,7 +86,7 @@ public function isInternal(): TrinaryLogic return TrinaryLogic::createNo(); } - public function getThrowType(): ?\PHPStan\Type\Type + public function getThrowType(): ?Type { return null; } diff --git a/src/Type/Laminas/StdlibAbstractOptionsPropertiesClassReflectionExtension.php b/src/Type/Laminas/StdlibAbstractOptionsPropertiesClassReflectionExtension.php index 0848548..9fe7cf1 100644 --- a/src/Type/Laminas/StdlibAbstractOptionsPropertiesClassReflectionExtension.php +++ b/src/Type/Laminas/StdlibAbstractOptionsPropertiesClassReflectionExtension.php @@ -8,6 +8,7 @@ use PHPStan\Reflection\ClassReflection; use PHPStan\Reflection\PropertiesClassReflectionExtension; use PHPStan\Reflection\PropertyReflection; +use PHPStan\TrinaryLogic; use PHPStan\Type\Type; final class StdlibAbstractOptionsPropertiesClassReflectionExtension implements PropertiesClassReflectionExtension @@ -81,7 +82,7 @@ public function canChangeTypeAfterAssignment(): bool return $this->classReflection->getNativeProperty($this->propertyName)->canChangeTypeAfterAssignment(); } - public function isDeprecated(): \PHPStan\TrinaryLogic + public function isDeprecated(): TrinaryLogic { return $this->classReflection->getNativeProperty($this->propertyName)->isDeprecated(); } @@ -91,7 +92,7 @@ public function getDeprecatedDescription(): ?string return $this->classReflection->getNativeProperty($this->propertyName)->getDeprecatedDescription(); } - public function isInternal(): \PHPStan\TrinaryLogic + public function isInternal(): TrinaryLogic { return $this->classReflection->getNativeProperty($this->propertyName)->isInternal(); } diff --git a/tests/LaminasIntegration/servicemanagerloader.php b/tests/LaminasIntegration/servicemanagerloader.php index ae9edb2..0c59b06 100644 --- a/tests/LaminasIntegration/servicemanagerloader.php +++ b/tests/LaminasIntegration/servicemanagerloader.php @@ -3,6 +3,7 @@ declare(strict_types=1); use Laminas\ModuleManager\Feature\ConfigProviderInterface; +use Laminas\Mvc\Application; use Laminas\ServiceManager\Factory\InvokableFactory; use LaminasPhpStan\TestAsset\BarService; use LaminasPhpStan\TestAsset\CssService; @@ -12,7 +13,7 @@ use LaminasPhpStan\TestAsset\Route66; use LaminasPhpStan\TestAsset\XyzController; -$app = \Laminas\Mvc\Application::init([ +$app = Application::init([ 'modules' => [ 'Laminas\Router', 'LaminasPhpStan' => new class() implements ConfigProviderInterface {