[Added] PHPStan lvl 5, error-ignoring; [Fixed] user-Getter evaluation

This commit is contained in:
MaxBUhe 2024-01-19 11:54:48 +01:00
parent 268cf6f6da
commit 1a641de8fc
2 changed files with 3 additions and 3 deletions

View File

@ -162,7 +162,7 @@ class ViewConfig extends ViewConfig_parent
$oConfig = Registry::getConfig();
$oView = $oConfig->getTopActiveView();
/** @var User $oUser */
/** @var User|false|null $oUser */
$oUser = $oConfig->getUser();
$cl = $this->getTopActiveClassName();
@ -185,7 +185,7 @@ class ViewConfig extends ViewConfig_parent
'title' => $oView->getTitle(),
'cl' => $cl,
],
'userid' => is_bool($oUser) ? false : $oUser->getId(),
'userid' => $oUser instanceof User ? $oUser->getId() : false,
'sessionid' => session_id(),
//'httpref' => $_SERVER["HTTP_REFERER"] ?? "unknown"
];

View File

@ -8,7 +8,7 @@ parameters:
- ../../../../Shops/CE/6.1.x/616_/vendor/oxid-esales
ignoreErrors:
- '#.*is not subtype of Throwable.*#'
- '#Parameter \#2 \$sValue of method OxidEsales\\EshopCommunity\\Core\\Controller\\BaseController::addTplParam\(\) expects string, true given#'
- '#\$sValue of method OxidEsales\\EshopCommunity\\Core\\Controller\\BaseController::addTplParam\(\) expects string,[ a-zA-Z\.]+#'
paths:
- ./
level: 5