Skip to content

Commit

Permalink
[TASK] Avoid a useless false check
Browse files Browse the repository at this point in the history
implode() always returns string, $actualViewHelperClassName
can never be false.
  • Loading branch information
lolli42 authored and s2b committed Nov 20, 2024
1 parent b386601 commit 5535e1f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
6 changes: 0 additions & 6 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -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\<array\<string\>\|string\> given\.$#'
identifier: argument.type
Expand Down
2 changes: 1 addition & 1 deletion src/Core/ViewHelper/ViewHelperResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.',
Expand Down

0 comments on commit 5535e1f

Please sign in to comment.