From 5fa995df3e70be42ebd7d31634e5db76a3d64b17 Mon Sep 17 00:00:00 2001 From: Massimiliano Arione Date: Sat, 30 Oct 2021 10:48:39 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20fix=20stan?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitattributes | 1 + composer.json | 5 +++-- phpstan.neon | 4 ++++ src/Form/Messenger/AbstractBusType.php | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 phpstan.neon diff --git a/.gitattributes b/.gitattributes index 3f33ddc..c60a4b0 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2,6 +2,7 @@ /.php-cs-fixer.* export-ignore /CHANGELOG.md export-ignore /docs/ export-ignore +/phpstan*.neon export-ignore /phpunit.xml.dist export-ignore /LICENSE export-ignore /README.md export-ignore diff --git a/composer.json b/composer.json index edfee04..20850c8 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,8 @@ ], "require": { "php": "^7.3 || ^8.0", - "symfony/form": "^4.4 || ^5.0 || ^6.0" + "symfony/form": "^4.4 || ^5.0 || ^6.0", + "symfony/framework-bundle": "^4.4 || ^5.0 || ^6.0" }, "require-dev": { "phpunit/phpunit": "^9.5", @@ -20,7 +21,7 @@ }, "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.x-dev" } }, "autoload": { diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 0000000..776ccd8 --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,4 @@ +parameters: + level: max + paths: + - src diff --git a/src/Form/Messenger/AbstractBusType.php b/src/Form/Messenger/AbstractBusType.php index 920f8b8..9ab9854 100644 --- a/src/Form/Messenger/AbstractBusType.php +++ b/src/Form/Messenger/AbstractBusType.php @@ -46,7 +46,7 @@ public function handle(FormEvent $event, object $command): void $prev = $exception->getPrevious(); if ($prev instanceof \DomainException || $prev instanceof \InvalidArgumentException) { $event->getForm()->addError(new FormError($prev->getMessage())); - } else { + } elseif (null !== $prev) { throw $prev; } } catch (\DomainException | \InvalidArgumentException $exception) {