Skip to content

Commit

Permalink
Update all non-major dependencies (#55)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
renovate[bot] and Slamdunk authored Jan 8, 2024
1 parent 75e9ecf commit e65f72d
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 15 deletions.
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 2 additions & 1 deletion src/Rules/Laminas/ServiceManagerGetMethodCallRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -35,7 +36,7 @@ public function getNodeType(): string
}

/**
* @param \PhpParser\Node\Expr\MethodCall $node
* @param MethodCall $node
*
* @return string[]
*/
Expand Down
8 changes: 5 additions & 3 deletions src/ServiceManagerLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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,
Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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(),
Expand All @@ -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(),
Expand Down
3 changes: 2 additions & 1 deletion src/Type/Laminas/PluginMethodReflection.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -85,7 +86,7 @@ public function isInternal(): TrinaryLogic
return TrinaryLogic::createNo();
}

public function getThrowType(): ?\PHPStan\Type\Type
public function getThrowType(): ?Type
{
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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();
}
Expand All @@ -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();
}
Expand Down
3 changes: 2 additions & 1 deletion tests/LaminasIntegration/servicemanagerloader.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 {
Expand Down

0 comments on commit e65f72d

Please sign in to comment.