diff --git a/composer.json b/composer.json index 5308d33dd..e1f64ca02 100644 --- a/composer.json +++ b/composer.json @@ -51,7 +51,7 @@ "require-dev": { "ext-pcntl": "*", "phpunit/phpunit": "^9.5", - "phpstan/phpstan": "^0.12", + "phpstan/phpstan": "^1.0", "queue-interop/queue-spec": "^0.6.2", "symfony/browser-kit": "^6.2|^7.0", "symfony/config": "^6.2|^7.0", @@ -60,9 +60,9 @@ "symfony/dependency-injection": "^6.2|^7.0", "symfony/event-dispatcher": "^6.2|^7.0", "symfony/expression-language": "^6.2|^7.0", - "symfony/http-kernel": "^^6.2|^7.0", + "symfony/http-kernel": "^6.2|^7.0", "symfony/filesystem": "^6.2|^7.0", - "symfony/framework-bundle": "^^6.2|^7.0", + "symfony/framework-bundle": "^6.2|^7.0", "symfony/validator": "^6.2|^7.0", "symfony/yaml": "^6.2|^7.0", "empi89/php-amqp-stubs": "*@dev", diff --git a/phpstan.neon b/phpstan.neon index 3bd6187d9..88be8a7e1 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,5 +1,5 @@ parameters: - excludes_analyse: + excludePaths: - docs - bin - docker diff --git a/pkg/enqueue-bundle/DependencyInjection/EnqueueExtension.php b/pkg/enqueue-bundle/DependencyInjection/EnqueueExtension.php index c5dbbbc96..96fca6fde 100644 --- a/pkg/enqueue-bundle/DependencyInjection/EnqueueExtension.php +++ b/pkg/enqueue-bundle/DependencyInjection/EnqueueExtension.php @@ -22,10 +22,10 @@ use Symfony\Component\Config\FileLocator; use Symfony\Component\Config\Resource\FileResource; use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\Extension\Extension; use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface; use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\HttpKernel\DependencyInjection\Extension; final class EnqueueExtension extends Extension implements PrependExtensionInterface { diff --git a/pkg/enqueue-bundle/Profiler/AbstractMessageQueueCollector.php b/pkg/enqueue-bundle/Profiler/AbstractMessageQueueCollector.php index 323d146d1..e2e5eee5a 100644 --- a/pkg/enqueue-bundle/Profiler/AbstractMessageQueueCollector.php +++ b/pkg/enqueue-bundle/Profiler/AbstractMessageQueueCollector.php @@ -59,8 +59,6 @@ public function prettyPrintPriority($priority) } /** - * @param mixed $body - * * @return string */ public function ensureString($body) @@ -68,18 +66,12 @@ public function ensureString($body) return is_string($body) ? $body : JSON::encode($body); } - /** - * {@inheritdoc} - */ public function getName(): string { return 'enqueue.message_queue'; } - /** - * {@inheritdoc} - */ - public function reset() + public function reset(): void { $this->data = []; } diff --git a/pkg/enqueue-bundle/Profiler/MessageQueueCollector.php b/pkg/enqueue-bundle/Profiler/MessageQueueCollector.php index 7fc6699c5..3c484a7d1 100644 --- a/pkg/enqueue-bundle/Profiler/MessageQueueCollector.php +++ b/pkg/enqueue-bundle/Profiler/MessageQueueCollector.php @@ -4,11 +4,10 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; -use Throwable; class MessageQueueCollector extends AbstractMessageQueueCollector { - public function collect(Request $request, Response $response, Throwable $exception = null) + public function collect(Request $request, Response $response, ?\Throwable $exception = null): void { $this->collectInternal($request, $response); } diff --git a/pkg/enqueue-bundle/Tests/Unit/DependencyInjection/EnqueueExtensionTest.php b/pkg/enqueue-bundle/Tests/Unit/DependencyInjection/EnqueueExtensionTest.php index 51bbaa26d..3b8d0426d 100644 --- a/pkg/enqueue-bundle/Tests/Unit/DependencyInjection/EnqueueExtensionTest.php +++ b/pkg/enqueue-bundle/Tests/Unit/DependencyInjection/EnqueueExtensionTest.php @@ -13,8 +13,8 @@ use Enqueue\Test\ClassExtensionTrait; use PHPUnit\Framework\TestCase; use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\Extension\Extension; use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\HttpKernel\DependencyInjection\Extension; class EnqueueExtensionTest extends TestCase { @@ -22,12 +22,12 @@ class EnqueueExtensionTest extends TestCase public function testShouldImplementConfigurationInterface() { - self::assertClassExtends(Extension::class, EnqueueExtension::class); + $this->assertClassExtends(Extension::class, EnqueueExtension::class); } public function testShouldBeFinal() { - self::assertClassFinal(EnqueueExtension::class); + $this->assertClassFinal(EnqueueExtension::class); } public function testCouldBeConstructedWithoutAnyArguments()