From e238fd7226a8276c8e6e6e5f2f3dbacadc64ffdd Mon Sep 17 00:00:00 2001 From: Sven Reichel Date: Sat, 17 Dec 2022 05:16:07 +0100 Subject: [PATCH] DOC updates --- .../core/Mage/Page/Block/Html/Breadcrumbs.php | 4 ++-- app/code/core/Mage/Page/Block/Html/Head.php | 4 ++-- app/code/core/Mage/Page/Block/Html/Pager.php | 2 ++ phpstan.dist.baseline.neon | 20 ------------------- 4 files changed, 6 insertions(+), 24 deletions(-) diff --git a/app/code/core/Mage/Page/Block/Html/Breadcrumbs.php b/app/code/core/Mage/Page/Block/Html/Breadcrumbs.php index 0e09d7c98b3..99518ede84d 100644 --- a/app/code/core/Mage/Page/Block/Html/Breadcrumbs.php +++ b/app/code/core/Mage/Page/Block/Html/Breadcrumbs.php @@ -61,7 +61,7 @@ public function __construct() /** * @param string $crumbName * @param array $crumbInfo - * @param bool $after + * @param string|bool $after * @return $this */ public function addCrumb($crumbName, $crumbInfo, $after = false) @@ -86,7 +86,7 @@ public function addCrumb($crumbName, $crumbInfo, $after = false) public function addCrumbBefore($crumbName, $crumbInfo, $before = false) { if ($before && isset($this->_crumbs[$before])) { - $keys = array_keys($this->_crumbs); + $keys = array_keys($this->_crumbs); $offset = array_search($before, $keys, true); # add before first if (!$offset) { diff --git a/app/code/core/Mage/Page/Block/Html/Head.php b/app/code/core/Mage/Page/Block/Html/Head.php index 67e35abc609..39c067aa30c 100644 --- a/app/code/core/Mage/Page/Block/Html/Head.php +++ b/app/code/core/Mage/Page/Block/Html/Head.php @@ -132,7 +132,7 @@ public function addLinkRel($rel, $href) * @param string $if * @param string $cond * @param string $referenceName name of the item to insert the element before. If name is not found, insert at the end, * has special meaning (before all / before all) - * @param bool $before If true insert before the $referenceName instead of after + * @param string|bool $before If true insert before the $referenceName instead of after * @return $this */ public function addItem($type, $name, $params = null, $if = null, $cond = null, $referenceName = "*", $before = false) @@ -563,7 +563,7 @@ protected function _isFile($filename) /** * @param string $referenceName - * @param string $before + * @param string|bool $before * @param string $type */ protected function _sortItems($referenceName, $before, $type) diff --git a/app/code/core/Mage/Page/Block/Html/Pager.php b/app/code/core/Mage/Page/Block/Html/Pager.php index 375ee6fbab8..d4e83998aa5 100644 --- a/app/code/core/Mage/Page/Block/Html/Pager.php +++ b/app/code/core/Mage/Page/Block/Html/Pager.php @@ -298,6 +298,8 @@ public function getPages() { $collection = $this->getCollection(); + $start = 1; + $finish = 1; $pages = []; if ($collection->getLastPageNumber() <= $this->_displayPages) { $pages = range(1, $collection->getLastPageNumber()); diff --git a/phpstan.dist.baseline.neon b/phpstan.dist.baseline.neon index 6e3c6963e99..1e2c5dfd6e7 100644 --- a/phpstan.dist.baseline.neon +++ b/phpstan.dist.baseline.neon @@ -10365,26 +10365,6 @@ parameters: count: 1 path: app/code/core/Mage/Page/Block/Html/Breadcrumbs.php - - - message: "#^Parameter \\#3 \\$after of method Mage_Page_Block_Html_Breadcrumbs\\:\\:addCrumb\\(\\) expects bool, \\(int\\|string\\) given\\.$#" - count: 1 - path: app/code/core/Mage/Page/Block/Html/Breadcrumbs.php - - - - message: "#^Parameter \\#2 \\$before of method Mage_Page_Block_Html_Head\\:\\:_sortItems\\(\\) expects string, bool given\\.$#" - count: 1 - path: app/code/core/Mage/Page/Block/Html/Head.php - - - - message: "#^Variable \\$finish might not be defined\\.$#" - count: 1 - path: app/code/core/Mage/Page/Block/Html/Pager.php - - - - message: "#^Variable \\$start might not be defined\\.$#" - count: 1 - path: app/code/core/Mage/Page/Block/Html/Pager.php - - message: "#^If condition is always true\\.$#" count: 1