Skip to content

Commit

Permalink
Bump phpstan/phpstan from 1.10.59 to 1.10.66 (#3880)
Browse files Browse the repository at this point in the history
Co-authored-by: Fabrizio Balliano <fabrizio.balliano@gmail.com>
  • Loading branch information
dependabot[bot] and fballiano authored Apr 2, 2024
1 parent 8bb7561 commit 46f884f
Show file tree
Hide file tree
Showing 14 changed files with 40 additions and 44 deletions.
1 change: 1 addition & 0 deletions app/code/core/Mage/Adminhtml/Model/Config/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,7 @@ protected function _getPathConfig($path, $full = true)
* @param string $path
* @param null|bool $inherit
* @param null|array $configData
* @param-out bool $inherit
* @return Varien_Simplexml_Element
*/
public function getConfigDataValue($path, &$inherit = null, $configData = null)
Expand Down
4 changes: 3 additions & 1 deletion app/code/core/Mage/Api/Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,8 @@ public function packArrayToObject(array $arr)
/**
* Convert objects and arrays to array recursively
*
* @param array|object $data
* @param array|object $data
* @param-out array $data
*/
public function toArray(&$data)
{
Expand Down Expand Up @@ -323,6 +324,7 @@ protected function _parseComplexFilter($complexFilter)
*
* @param string $conditionOperator
* @param string $conditionValue
* @param-out string|array $conditionValue
*/
public function formatFilterConditionValue($conditionOperator, &$conditionValue)
{
Expand Down
17 changes: 12 additions & 5 deletions app/code/core/Mage/Api/Model/Server/Handler/Abstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -270,11 +270,14 @@ public function call($sessionId, $apiPath, $args = [])
}

$methodInfo = $resources->$resourceName->methods->$methodName;
$method = (isset($methodInfo->method) ? (string) $methodInfo->method : $methodName);

try {
$method = (isset($methodInfo->method) ? (string) $methodInfo->method : $methodName);
if (!isset($resources->$resourceName->model)) {
throw new Mage_Api_Exception('resource_path_not_callable');
}

$modelName = $this->_prepareResourceModelName((string) $resources->$resourceName->model);
try {
$modelName = $this->_prepareResourceModelName((string)$resources->$resourceName->model);
try {
$model = Mage::getModel($modelName);
if ($model instanceof Mage_Api_Model_Resource_Abstract) {
Expand Down Expand Up @@ -390,11 +393,15 @@ public function multiCall($sessionId, array $calls = [], $options = [])
}

$methodInfo = $resources->$resourceName->methods->$methodName;
$method = (isset($methodInfo->method) ? (string) $methodInfo->method : $methodName);

try {
$method = (isset($methodInfo->method) ? (string) $methodInfo->method : $methodName);
if (!isset($resources->$resourceName->model)) {
throw new Mage_Api_Exception('resource_path_not_callable');
}

try {
$modelName = $this->_prepareResourceModelName((string) $resources->$resourceName->model);

try {
$model = Mage::getModel($modelName);
} catch (Exception $e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function prepareTierPrices($product, $tierPrices = null)
}

if (!isset($tierPrice->website) || $tierPrice->website == 'all') {
$tierPrice->website = 0;
$tierPrice->website = 0; // @phpstan-ignore-line
} else {
try {
$tierPrice->website = Mage::app()->getWebsite($tierPrice->website)->getId();
Expand All @@ -59,7 +59,7 @@ public function prepareTierPrices($product, $tierPrices = null)
}

if (!isset($tierPrice->customer_group_id)) {
$tierPrice->customer_group_id = 'all';
$tierPrice->customer_group_id = 'all'; // @phpstan-ignore-line
}

if ($tierPrice->customer_group_id == 'all') {
Expand Down
8 changes: 5 additions & 3 deletions app/code/core/Mage/CatalogSearch/Block/Term.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,12 @@ protected function _loadTerms()
$temp[$term->getName()] = $term;
$termKeys[] = $term->getName();
}
natcasesort($termKeys);

foreach ($termKeys as $termKey) {
$this->_terms[$termKey] = $temp[$termKey];
if (isset($termKeys)) {
natcasesort($termKeys);
foreach ($termKeys as $termKey) {
$this->_terms[$termKey] = $temp[$termKey];
}
}
}
return $this;
Expand Down
1 change: 1 addition & 0 deletions app/code/core/Mage/Core/Model/Input/Filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ public function filter($data)
* @param array $data
* @param array|null $filters
* @param bool $isFilterListSimple
* @param-out array $filters
* @return array
* @throws Exception Exception when filter is not found or not instance of defined instances
*/
Expand Down
2 changes: 2 additions & 0 deletions app/code/core/Mage/Core/Model/Translate/Inline.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ public function processAjaxPost($translate)
* Strip inline translations from text
*
* @param array|string $body
* @param-out array|string|null $body
* @return $this
*/
public function stripInlineTranslations(&$body)
Expand All @@ -200,6 +201,7 @@ public function stripInlineTranslations(&$body)
* Replace translate templates to HTML fragments
*
* @param array|string $body
* @param-out array|string|null $body
* @return $this
*/
public function processResponseBody(&$body)
Expand Down
1 change: 1 addition & 0 deletions app/code/core/Mage/Downloadable/Model/Link/Api/V2.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class Mage_Downloadable_Model_Link_Api_V2 extends Mage_Downloadable_Model_Link_A
* Clean the object, leave only property values
*
* @param object $var
* @param-out array $var
*/
protected function _prepareData(&$var)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ public function validateNumOfDownloads(&$var)
* Validate variable, in case of fault loads default entity.
*
* @param int|bool $var
* @param-out int $var
*/
public function validateUnlimited(&$var)
{
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Paypal/Model/Api/Standard.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ protected function _exportLineItems(array &$request, $i = 1)
/**
* Import address object, if set, to the request
*
* @param array $request
* @param array|Varien_Object $request
*/
protected function _importAddress(&$request)
{
Expand Down
12 changes: 5 additions & 7 deletions app/code/core/Mage/Sales/Model/Order/Payment/Transaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -675,13 +675,11 @@ protected function _loadChildren()
$child->setOrderPaymentObject($payment);
}
$this->_children[$child->getId()] = $child;
if ($this->_identifiedChildren !== false) {
$childTxnId = $child->getTxnId();
if (!$childTxnId || $childTxnId == '0') {
$this->_identifiedChildren = false;
} else {
$this->_identifiedChildren[$child->getTxnId()] = $child;
}
$childTxnId = $child->getTxnId();
if (!$childTxnId || $childTxnId == '0') {
$this->_identifiedChildren = false;
} else {
$this->_identifiedChildren[$child->getTxnId()] = $child;
}
}
if ($this->_identifiedChildren === false) {
Expand Down
10 changes: 5 additions & 5 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/Varien/Db/Adapter/Pdo/Mysql.php
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,7 @@ public function query($sql, $bind = [])
* with named binds.
*
* @param Zend_Db_Select|string $sql
* @param-out string $sql
* @param mixed $bind
* @return $this
*/
Expand Down
20 changes: 0 additions & 20 deletions phpstan.dist.baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -740,11 +740,6 @@ parameters:
count: 1
path: app/code/core/Mage/Api/Model/Server/Adapter/Soap.php

-
message: "#^Access to an undefined property object\\:\\:\\$model\\.$#"
count: 2
path: app/code/core/Mage/Api/Model/Server/Handler/Abstract.php

-
message: "#^Result of method SoapServer\\:\\:handle\\(\\) \\(void\\) is used\\.$#"
count: 1
Expand Down Expand Up @@ -1560,16 +1555,6 @@ parameters:
count: 1
path: app/code/core/Mage/Catalog/Model/Product/Attribute/Media/Api/V2.php

-
message: "#^Access to an undefined property object\\:\\:\\$customer_group_id\\.$#"
count: 1
path: app/code/core/Mage/Catalog/Model/Product/Attribute/Tierprice/Api/V2.php

-
message: "#^Access to an undefined property object\\:\\:\\$website\\.$#"
count: 1
path: app/code/core/Mage/Catalog/Model/Product/Attribute/Tierprice/Api/V2.php

-
message: "#^Method Mage_Catalog_Model_Resource_Product_Compare_Item\\:\\:clean\\(\\) invoked with 1 parameter, 0 required\\.$#"
count: 1
Expand Down Expand Up @@ -2035,11 +2020,6 @@ parameters:
count: 1
path: app/code/core/Mage/CatalogSearch/Block/Term.php

-
message: "#^Variable \\$termKeys might not be defined\\.$#"
count: 2
path: app/code/core/Mage/CatalogSearch/Block/Term.php

-
message: "#^Property Mage_CatalogSearch_Helper_Data\\:\\:\\$_queryText \\(string\\) in isset\\(\\) is not nullable\\.$#"
count: 1
Expand Down

0 comments on commit 46f884f

Please sign in to comment.