From 8499284d5fd894f2d0462e32cffbcf466386e2d2 Mon Sep 17 00:00:00 2001 From: Daniel Siepmann Date: Thu, 28 Nov 2024 07:46:07 +0100 Subject: [PATCH] Ease entity registration Remove phpstan errors and ease code. Directly call the static methods instead of wrapping the call with call_user_func() for no reason. --- Classes/DependencyInjection/EntityPass.php | 4 ++-- phpstan-baseline.neon | 10 ---------- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/Classes/DependencyInjection/EntityPass.php b/Classes/DependencyInjection/EntityPass.php index 34288bd..c541769 100644 --- a/Classes/DependencyInjection/EntityPass.php +++ b/Classes/DependencyInjection/EntityPass.php @@ -47,8 +47,8 @@ class EntityPass implements CompilerPassInterface 'registerEntityClass', [ $definition->getClass(), - call_user_func([$definition->getClass(), 'getPriority']), - call_user_func([$definition->getClass(), 'getSupportedTypes']), + $definition->getClass()::getPriority(), + $definition->getClass()::getSupportedTypes(), ] ); } diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index cf3b646..cf86fa3 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -1,15 +1,5 @@ parameters: ignoreErrors: - - - message: "#^Parameter \\#1 \\$callback of function call_user_func expects callable\\(\\)\\: mixed, array\\{class\\-string, 'getPriority'\\} given\\.$#" - count: 1 - path: Classes/DependencyInjection/EntityPass.php - - - - message: "#^Parameter \\#1 \\$callback of function call_user_func expects callable\\(\\)\\: mixed, array\\{class\\-string, 'getSupportedTypes'\\} given\\.$#" - count: 1 - path: Classes/DependencyInjection/EntityPass.php - - message: "#^Method WerkraumMedia\\\\ThueCat\\\\Domain\\\\Import\\\\EntityMapper\\:\\:mapDataToEntity\\(\\) should return object but returns mixed\\.$#" count: 1