From 1455c9f888e186f97a0bb8e684c7b13dd86b5564 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Mon, 23 May 2022 09:15:37 +0200 Subject: [PATCH] Document callable as possible Custom string functions can either be a class string or a callable returning the function. --- lib/Doctrine/ORM/Configuration.php | 5 ++--- psalm-baseline.xml | 9 +++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/Doctrine/ORM/Configuration.php b/lib/Doctrine/ORM/Configuration.php index 200298e2363..9756f27111f 100644 --- a/lib/Doctrine/ORM/Configuration.php +++ b/lib/Doctrine/ORM/Configuration.php @@ -608,7 +608,7 @@ public function addCustomStringFunction($name, $className) * @param string $name * * @return string|null - * @psalm-return ?class-string + * @psalm-return ?class-string|callable */ public function getCustomStringFunction($name) { @@ -625,8 +625,7 @@ public function getCustomStringFunction($name) * * Any previously added string functions are discarded. * - * @psalm-param array $functions The map of custom - * DQL string functions. + * @psalm-param array $functions The map of custom DQL string functions. * * @return void */ diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 5fc6d9ad965..c9fcdc06e95 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -2061,8 +2061,7 @@ $stringPattern - - call_user_func($functionClass, $functionName) + call_user_func($functionClass, $functionName) call_user_func($functionClass, $functionName) @@ -2117,6 +2116,9 @@ $this->lexer->token['value'] $this->lexer->token['value'] + + new $functionClass($functionName) + $function $function @@ -2250,11 +2252,10 @@ $args - + $AST instanceof AST\SelectStatement is_string($functionClass) is_string($functionClass) - is_string($functionClass) new $funcClass($funcNameLower)