From 5535e1fab578513a53dbfc6599993b9896aa04a3 Mon Sep 17 00:00:00 2001 From: Christian Kuhn Date: Wed, 20 Nov 2024 02:54:43 +0100 Subject: [PATCH] [TASK] Avoid a useless false check implode() always returns string, $actualViewHelperClassName can never be false. --- phpstan-baseline.neon | 6 ------ src/Core/ViewHelper/ViewHelperResolver.php | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index ec95eaaf6..69006267b 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -66,12 +66,6 @@ parameters: count: 1 path: src/Core/ViewHelper/AbstractViewHelper.php - - - message: '#^Strict comparison using \=\=\= between class\-string and false will always evaluate to false\.$#' - identifier: identical.alwaysFalse - count: 1 - path: src/Core/ViewHelper/ViewHelperResolver.php - - message: '#^Parameter \#1 \$array of function array_unique expects an array of values castable to string, array\\|string\> given\.$#' identifier: argument.type diff --git a/src/Core/ViewHelper/ViewHelperResolver.php b/src/Core/ViewHelper/ViewHelperResolver.php index a30645340..2a00a7f28 100644 --- a/src/Core/ViewHelper/ViewHelperResolver.php +++ b/src/Core/ViewHelper/ViewHelperResolver.php @@ -229,7 +229,7 @@ public function resolveViewHelperClassName(string $namespaceIdentifier, string $ if (!isset($this->resolvedViewHelperClassNames[$namespaceIdentifier][$methodIdentifier])) { $resolvedViewHelperClassName = $this->resolveViewHelperName($namespaceIdentifier, $methodIdentifier); $actualViewHelperClassName = implode('\\', array_map('ucfirst', explode('.', $resolvedViewHelperClassName))); - if (false === class_exists($actualViewHelperClassName) || $actualViewHelperClassName === false) { + if (!class_exists($actualViewHelperClassName)) { throw new ParserException(sprintf( 'The ViewHelper "<%s:%s>" could not be resolved.' . chr(10) . 'Based on your spelling, the system would load the class "%s", however this class does not exist.',