From 3df57c1569e620a7a8a2f8e056d5879aa3ea4d0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Wed, 10 Apr 2024 12:43:25 +0200 Subject: [PATCH] Remove nullable parameter from createNamedBuilder call The call to createNamedBuilder in EventController.php and ExportController.php was originally passing null as a parameter. This was generating PHPStan warnings. This commit replaces null with an empty string to comply with the method's expected types. --- phpstan-baseline-level-5.neon | 10 ---------- .../ChillMainBundle/Controller/ExportController.php | 2 +- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/phpstan-baseline-level-5.neon b/phpstan-baseline-level-5.neon index 23321ba68..34e2825a3 100644 --- a/phpstan-baseline-level-5.neon +++ b/phpstan-baseline-level-5.neon @@ -100,11 +100,6 @@ parameters: count: 1 path: src/Bundle/ChillEventBundle/Controller/EventController.php - - - message: "#^Parameter \\#1 \\$name of method Symfony\\\\Component\\\\Form\\\\FormFactoryInterface\\:\\:createNamedBuilder\\(\\) expects string, null given\\.$#" - count: 1 - path: src/Bundle/ChillEventBundle/Controller/EventController.php - - message: "#^Parameter \\#1 \\$value of function count expects array\\|Countable, Chill\\\\MainBundle\\\\Entity\\\\Center given\\.$#" count: 1 @@ -165,11 +160,6 @@ parameters: count: 1 path: src/Bundle/ChillMainBundle/Controller/ExportController.php - - - message: "#^Parameter \\#1 \\$name of method Symfony\\\\Component\\\\Form\\\\FormFactoryInterface\\:\\:createNamedBuilder\\(\\) expects string, null given\\.$#" - count: 1 - path: src/Bundle/ChillMainBundle/Controller/ExportController.php - - message: "#^Parameter \\#3 \\$alias of method Chill\\\\MainBundle\\\\Controller\\\\ExportController\\:\\:exportFormStep\\(\\) expects string, Symfony\\\\Component\\\\HttpFoundation\\\\Request given\\.$#" count: 1 diff --git a/src/Bundle/ChillMainBundle/Controller/ExportController.php b/src/Bundle/ChillMainBundle/Controller/ExportController.php index 2f166a585..c23ebfda2 100644 --- a/src/Bundle/ChillMainBundle/Controller/ExportController.php +++ b/src/Bundle/ChillMainBundle/Controller/ExportController.php @@ -288,7 +288,7 @@ class ExportController extends AbstractController $builder = $this->formFactory ->createNamedBuilder( - null, + '', FormType::class, $defaultFormData, [