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: Sitemap, Newsletter, ... #2823

Merged
merged 6 commits into from
Dec 20, 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
2 changes: 1 addition & 1 deletion app/Mage.php
Original file line number Diff line number Diff line change
Expand Up @@ -828,7 +828,7 @@ public static function isInstalled($options = [])
*
* @param array|object|string $message
* @param int $level
* @param string $file
* @param string|null $file
* @param bool $forceLog
*/
public static function log($message, $level = null, $file = '', $forceLog = false)
Expand Down
4 changes: 2 additions & 2 deletions app/code/core/Mage/AdminNotification/Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ class Mage_AdminNotification_Helper_Data extends Mage_Core_Helper_Abstract
/**
* Last Notice object
*
* @var Mage_AdminNotification_Model_Inbox
* @var Mage_AdminNotification_Model_Inbox|null
*/
protected $_latestNotice;

/**
* count of unread notes by type
*
* @var array
* @var array|null
*/
protected $_unreadNoticeCounts;

Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/AdminNotification/Model/Feed.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class Mage_AdminNotification_Model_Feed extends Mage_Core_Model_Abstract
/**
* Feed url
*
* @var string
* @var string|null
*/
protected $_feedUrl;

Expand Down
3 changes: 2 additions & 1 deletion app/code/core/Mage/Contacts/controllers/IndexController.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class Mage_Contacts_IndexController extends Mage_Core_Controller_Front_Action
public const XML_PATH_ENABLED = 'contacts/contacts/enabled';

/**
* @return void
* @return $this
*/
public function preDispatch()
{
Expand All @@ -43,6 +43,7 @@ public function preDispatch()
if (!Mage::getStoreConfigFlag(self::XML_PATH_ENABLED)) {
$this->norouteAction();
}
return $this;
}

public function indexAction()
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Core/Controller/Varien/Action.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ public function getFlag($action, $flag = '')
*
* @param string $action
* @param string $flag
* @param string|int $value
* @param string|int|bool $value
* @return $this
*/
public function setFlag($action, $flag, $value)
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Core/Model/Email/Template/Filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public function getPlainTemplateMode()
/**
* Setter
*
* @param int $storeId
* @param Mage_Core_Model_Store|int $storeId
* @return $this
*/
public function setStoreId($storeId)
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Customer/Model/Customer.php
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ public function getAttributes()
* Get customer attribute model object
*
* @param string $attributeCode
* @return Mage_Customer_Model_Entity_Attribute|null
* @return Mage_Customer_Model_Customer|null
* @throws Mage_Core_Exception
*/
public function getAttribute($attributeCode)
Expand Down
4 changes: 2 additions & 2 deletions app/code/core/Mage/Newsletter/Model/Problem.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class Mage_Newsletter_Model_Problem extends Mage_Core_Model_Abstract
/**
* Current Subscriber
*
* @var Mage_Newsletter_Model_Subscriber
* @var Mage_Newsletter_Model_Subscriber|null
*/
protected $_subscriber = null;

Expand Down Expand Up @@ -98,7 +98,7 @@ public function addErrorData(Exception $e)
/**
* Retrieve Subscriber
*
* @return Mage_Newsletter_Model_Subscriber
* @return Mage_Newsletter_Model_Subscriber|null
*/
public function getSubscriber()
{
Expand Down
4 changes: 2 additions & 2 deletions app/code/core/Mage/Newsletter/Model/Queue.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ class Mage_Newsletter_Model_Queue extends Mage_Core_Model_Template
/**
* Newsletter Template object
*
* @var Mage_Newsletter_Model_Template
* @var Mage_Newsletter_Model_Template|null
*/
protected $_template;

/**
* Subscribers collection
* @var Mage_Newsletter_Model_Resource_Subscriber_Collection
* @var Mage_Newsletter_Model_Resource_Subscriber_Collection|null
*/
protected $_subscribersCollection = null;

Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Newsletter/Model/Resource/Queue.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ public function getStores(Mage_Newsletter_Model_Queue $queue)
/**
* Saving template after saving queue action
*
* @param Mage_Core_Model_Abstract|Mage_Newsletter_Model_Queue $queue
* @param Mage_Newsletter_Model_Queue $queue
* @return $this
*/
protected function _afterSave(Mage_Core_Model_Abstract $queue)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ protected function _construct()
$this->_map['fields']['customer_middlename'] = 'customer_middlename_table.value';
$this->_map['fields']['customer_firstname'] = 'customer_firstname_table.value';
$this->_map['fields']['type'] = $this->getResource()->getReadConnection()
->getCheckSql('main_table.customer_id = 0', 1, 2);
->getCheckSql('main_table.customer_id = 0', '1', '2');
$this->_map['fields']['website_id'] = 'store.website_id';
$this->_map['fields']['group_id'] = 'store.group_id';
$this->_map['fields']['store_id'] = 'main_table.store_id';
Expand Down Expand Up @@ -189,7 +189,7 @@ public function _getFieldTableAlias($field)
}

if ($field == 'type') {
return $this->getConnection()->getCheckSql('main_table.customer_id = 0', 1, 2);
return $this->getConnection()->getCheckSql('main_table.customer_id = 0', '1', '2');
}

if (in_array($field, ['website_id', 'group_id'])) {
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Newsletter/Model/Subscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ public function setStatus($value)
/**
* Set the error messages scope for subscription
*
* @param bool $scope
* @param string $scope
* @return $this
*/

Expand Down
4 changes: 2 additions & 2 deletions app/code/core/Mage/Newsletter/Model/Template.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class Mage_Newsletter_Model_Template extends Mage_Core_Model_Email_Template_Abst
/**
* Mail object
*
* @var Zend_Mail
* @var Zend_Mail|null
*/
protected $_mail;

Expand Down Expand Up @@ -173,7 +173,7 @@ public function isPreprocessed()
/**
* Check Template Text Preprocessed
*
* @return bool
* @return string
*/
public function getTemplateTextPreprocessed()
{
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Sitemap/Model/Sitemap.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class Mage_Sitemap_Model_Sitemap extends Mage_Core_Model_Abstract
/**
* Real file path
*
* @var string
* @var string|null
*/
protected $_filePath;

Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Zend/Db/Select.php
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,7 @@ public function reset($part = null)
* Gets the Zend_Db_Adapter_Abstract for this
* particular Zend_Db_Select object.
*
* @return Zend_Db_Adapter_Abstract
* @return Varien_Db_Adapter_Interface|Zend_Db_Adapter_Abstract
*/
public function getAdapter()
{
Expand Down
2 changes: 1 addition & 1 deletion lib/Varien/Data/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ public function clear()
*
* Returns array with results of callback for each item
*
* @param callable $callback
* @param string|callable $callback
* @param array $args
* @return array
*/
Expand Down
2 changes: 1 addition & 1 deletion lib/Varien/Http/Adapter/Curl.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ public function write($method, $url, $http_ver = '1.1', $headers = [], $body = '
/**
* Read response from server
*
* @return string
* @return string|bool
*/
public function read()
{
Expand Down
Loading