Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

phpstan: Mage_Page #2820

Merged
merged 1 commit into from
Dec 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/code/core/Mage/Page/Block/Html/Breadcrumbs.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

space too much

$offset = array_search($before, $keys, true);
# add before first
if (!$offset) {
Expand Down
4 changes: 2 additions & 2 deletions app/code/core/Mage/Page/Block/Html/Head.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions app/code/core/Mage/Page/Block/Html/Pager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
20 changes: 0 additions & 20 deletions phpstan.dist.baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down