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

View File

@ -8,7 +8,7 @@ parameters:
- ../../../../Shops/CE/6.1.x/616_/vendor/oxid-esales - ../../../../Shops/CE/6.1.x/616_/vendor/oxid-esales
ignoreErrors: ignoreErrors:
- '#.*is not subtype of Throwable.*#' - '#.*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: paths:
- ./ - ./
level: 5 level: 5