From 5c46fd9f2baa815425239501406ddd196fea7fa4 Mon Sep 17 00:00:00 2001 From: Olivier Laviale Date: Thu, 21 Nov 2024 13:04:41 +0100 Subject: [PATCH] Use PHPStan 2.0 --- composer.json | 2 +- src/ClassAttributeCollector.php | 3 +-- src/Datastore/FileDatastore.php | 2 -- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index 19b3e50..25130bf 100644 --- a/composer.json +++ b/composer.json @@ -35,7 +35,7 @@ }, "require-dev": { "composer/composer": ">=2.4", - "phpstan/phpstan": "^1.9", + "phpstan/phpstan": "^2.0", "phpunit/phpunit": "^9.5" }, "extra": { diff --git a/src/ClassAttributeCollector.php b/src/ClassAttributeCollector.php index 731cd4b..c9b42c8 100644 --- a/src/ClassAttributeCollector.php +++ b/src/ClassAttributeCollector.php @@ -64,7 +64,6 @@ public function collectAttributes(string $class): array } $method = $methodReflection->name; - assert($method !== ''); $this->io->debug("Found attribute {$attribute->getName()} on $class::$method"); @@ -126,6 +125,6 @@ private static function isAttributeIgnored(ReflectionAttribute $attribute): bool InheritsAttributes::class => true, ]; - return isset($ignored[$attribute->getName()]); + return isset($ignored[$attribute->getName()]); // @phpstan-ignore offsetAccess.nonOffsetAccessible } } diff --git a/src/Datastore/FileDatastore.php b/src/Datastore/FileDatastore.php index c865869..c6d36e4 100644 --- a/src/Datastore/FileDatastore.php +++ b/src/Datastore/FileDatastore.php @@ -31,8 +31,6 @@ public function __construct( private string $dir, private IOInterface $io, ) { - assert($dir !== ''); - if (!is_dir($dir)) { mkdir($dir); }