Skip to content

Commit

Permalink
Applied some rector rules (#4201)
Browse files Browse the repository at this point in the history
- RemoveUselessReturnTagRector
- RemoveUselessParamTagRector
- RemoveUselessVarTagRector
  • Loading branch information
sreichel committed Sep 18, 2024
1 parent 76148af commit fb144ee
Show file tree
Hide file tree
Showing 852 changed files with 639 additions and 3,237 deletions.
14 changes: 0 additions & 14 deletions app/Mage.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,6 @@ public static function getOpenMageVersion(): string
* Gets the detailed OpenMage version information
* @link https://openmage.github.io/supported-versions.html
* @link https://semver.org/
*
* @return array
*/
public static function getOpenMageVersionInfo(): array
{
Expand Down Expand Up @@ -410,19 +408,15 @@ public static function getStoreConfig($path, $store = null)
}

/**
* @param string $path
* @param null|string|bool|int|Mage_Core_Model_Store $store
* @return float
*/
public static function getStoreConfigAsFloat(string $path, $store = null): float
{
return (float) self::getStoreConfig($path, $store);
}

/**
* @param string $path
* @param null|string|bool|int|Mage_Core_Model_Store $store
* @return int
*/
public static function getStoreConfigAsInt(string $path, $store = null): int
{
Expand Down Expand Up @@ -518,7 +512,6 @@ public static function addObserver($eventName, $callback, $data = [], $observerN
* and multiple observers matching event name pattern
*
* @param string $name
* @param array $data
* @return Mage_Core_Model_App
*/
public static function dispatchEvent($name, array $data = [])
Expand Down Expand Up @@ -546,7 +539,6 @@ public static function getModel($modelClass = '', $arguments = [])
* Retrieve model object singleton
*
* @param string $modelClass
* @param array $arguments
* @return Mage_Core_Model_Abstract|false
*/
public static function getSingleton($modelClass = '', array $arguments = [])
Expand Down Expand Up @@ -576,7 +568,6 @@ public static function getResourceModel($modelClass, $arguments = [])
* @param string $class
* @param Mage_Core_Controller_Request_Http $request
* @param Mage_Core_Controller_Response_Http $response
* @param array $invokeArgs
* @return Mage_Core_Controller_Front_Action
*/
public static function getControllerInstance($class, $request, $response, array $invokeArgs = [])
Expand All @@ -588,7 +579,6 @@ public static function getControllerInstance($class, $request, $response, array
* Retrieve resource vodel object singleton
*
* @param string $modelClass
* @param array $arguments
* @return object
*/
public static function getResourceSingleton($modelClass = '', array $arguments = [])
Expand Down Expand Up @@ -945,8 +935,6 @@ public static function log($message, $level = null, $file = '', $forceLog = fals

/**
* Write exception to log
*
* @param Throwable $e
*/
public static function logException(Throwable $e)
{
Expand Down Expand Up @@ -981,8 +969,6 @@ public static function getIsDeveloperMode()

/**
* Display exception
*
* @param Throwable $e
*/
public static function printException(Throwable $e, $extra = '')
{
Expand Down
3 changes: 0 additions & 3 deletions app/code/core/Mage/Admin/Model/Acl/Assert/Ip.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ class Mage_Admin_Model_Acl_Assert_Ip implements Zend_Acl_Assert_Interface
/**
* Check whether ip is allowed
*
* @param Mage_Admin_Model_Acl $acl
* @param Mage_Admin_Model_Acl_Role|null $role
* @param Mage_Admin_Model_Acl_Resource|null $resource
* @param string|null $privilege
* @return bool|null
*/
Expand Down
3 changes: 0 additions & 3 deletions app/code/core/Mage/Admin/Model/Acl/Assert/Time.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ class Mage_Admin_Model_Acl_Assert_Time implements Zend_Acl_Assert_Interface
/**
* Assert time
*
* @param Mage_Admin_Model_Acl $acl
* @param Mage_Admin_Model_Acl_Role|null $role
* @param Mage_Admin_Model_Acl_Resource|null $resource
* @param string|null $privilege
* @return bool|null
*/
Expand Down
1 change: 0 additions & 1 deletion app/code/core/Mage/Admin/Model/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ public function __construct()
/**
* Load Acl resources from config
*
* @param Mage_Admin_Model_Acl $acl
* @param Mage_Core_Model_Config_Element|Varien_Simplexml_Element $resource
* @param string $parentName
* @return $this
Expand Down
2 changes: 0 additions & 2 deletions app/code/core/Mage/Admin/Model/Redirectpolicy.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ public function __construct($parameters = [])
/**
* Redirect to startup page after logging in if request contains any params (except security key)
*
* @param Mage_Admin_Model_User $user
* @param Zend_Controller_Request_Http|null $request
* @param string|null $alternativeUrl
* @return null|string
*/
Expand Down
4 changes: 0 additions & 4 deletions app/code/core/Mage/Admin/Model/Resource/Acl.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ public function loadAcl()
/**
* Load roles
*
* @param Mage_Admin_Model_Acl $acl
* @param array $rolesArr
* @return $this
*/
public function loadRoles(Mage_Admin_Model_Acl $acl, array $rolesArr)
Expand Down Expand Up @@ -106,8 +104,6 @@ public function loadRoles(Mage_Admin_Model_Acl $acl, array $rolesArr)
/**
* Load rules
*
* @param Mage_Admin_Model_Acl $acl
* @param array $rulesArr
* @return $this
*/
public function loadRules(Mage_Admin_Model_Acl $acl, array $rulesArr)
Expand Down
3 changes: 1 addition & 2 deletions app/code/core/Mage/Admin/Model/Resource/Role.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* @category Mage
* @package Mage_Admin
* @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com)
* @copyright Copyright (c) 2019-2023 The OpenMage Contributors (https://www.openmage.org)
* @copyright Copyright (c) 2019-2024 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/

Expand All @@ -29,7 +29,6 @@ protected function _construct()
/**
* Process role before saving
*
* @param Mage_Core_Model_Abstract|Mage_Admin_Model_Role $object
* @return $this
*/
protected function _beforeSave(Mage_Core_Model_Abstract $object)
Expand Down
7 changes: 1 addition & 6 deletions app/code/core/Mage/Admin/Model/Resource/Roles.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* @category Mage
* @package Mage_Admin
* @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com)
* @copyright Copyright (c) 2019-2023 The OpenMage Contributors (https://www.openmage.org)
* @copyright Copyright (c) 2019-2024 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/

Expand Down Expand Up @@ -46,7 +46,6 @@ protected function _construct()
/**
* Process role before saving
*
* @param Mage_Core_Model_Abstract|Mage_Admin_Model_Roles $role
* @return $this
*/
protected function _beforeSave(Mage_Core_Model_Abstract $role)
Expand Down Expand Up @@ -82,7 +81,6 @@ protected function _beforeSave(Mage_Core_Model_Abstract $role)
/**
* Process role after saving
*
* @param Mage_Core_Model_Abstract $role
* @return $this
*/
protected function _afterSave(Mage_Core_Model_Abstract $role)
Expand All @@ -98,7 +96,6 @@ protected function _afterSave(Mage_Core_Model_Abstract $role)
/**
* Process role after deleting
*
* @param Mage_Core_Model_Abstract $role
* @return $this
*/
protected function _afterDelete(Mage_Core_Model_Abstract $role)
Expand All @@ -112,7 +109,6 @@ protected function _afterDelete(Mage_Core_Model_Abstract $role)
/**
* Get role users
*
* @param Mage_Admin_Model_Roles $role
* @return array
*/
public function getRoleUsers(Mage_Admin_Model_Roles $role)
Expand All @@ -129,7 +125,6 @@ public function getRoleUsers(Mage_Admin_Model_Roles $role)
/**
* Update role users
*
* @param Mage_Admin_Model_Roles $role
* @return bool
*/
private function _updateRoleUsersAcl(Mage_Admin_Model_Roles $role)
Expand Down
4 changes: 0 additions & 4 deletions app/code/core/Mage/Admin/Model/Resource/Rules.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ protected function _construct()

/**
* Save ACL resources
*
* @param Mage_Admin_Model_Rules $rule
*/
public function saveRel(Mage_Admin_Model_Rules $rule)
{
Expand Down Expand Up @@ -96,8 +94,6 @@ public function setResourceIdAsIdFieldName()
/**
* Delete orphaned resources
*
* @param array $orphanedIds
* @return int
* @throws Mage_Core_Exception
*/
public function deleteOrphanedResources(array $orphanedIds): int
Expand Down
12 changes: 1 addition & 11 deletions app/code/core/Mage/Admin/Model/Resource/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* @category Mage
* @package Mage_Admin
* @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com)
* @copyright Copyright (c) 2017-2023 The OpenMage Contributors (https://www.openmage.org)
* @copyright Copyright (c) 2017-2024 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/

Expand Down Expand Up @@ -47,7 +47,6 @@ protected function _initUniqueFields()
/**
* Authenticate user by $username and $password
*
* @param Mage_Admin_Model_User $user
* @return $this
*/
public function recordLogin(Mage_Admin_Model_User $user)
Expand Down Expand Up @@ -154,7 +153,6 @@ protected function _beforeSave(Mage_Core_Model_Abstract $user)
/**
* Unserialize user extra data after user save
*
* @param Mage_Core_Model_Abstract $user
* @return $this
*/
protected function _afterSave(Mage_Core_Model_Abstract $user)
Expand All @@ -176,7 +174,6 @@ protected function _afterLoad(Mage_Core_Model_Abstract $user)
/**
* Delete user role record with user
*
* @param Mage_Core_Model_Abstract $user
* @return $this
* @throws Exception
*/
Expand Down Expand Up @@ -206,7 +203,6 @@ public function delete(Mage_Core_Model_Abstract $user)
/**
* TODO: unify _saveRelations() and add() methods, they make same things
*
* @param Mage_Core_Model_Abstract|Mage_Admin_Model_User $user
* @return $this|Mage_Core_Model_Abstract
*/
public function _saveRelations(Mage_Core_Model_Abstract $user)
Expand Down Expand Up @@ -265,7 +261,6 @@ public function _saveRelations(Mage_Core_Model_Abstract $user)
/**
* Get user roles
*
* @param Mage_Core_Model_Abstract $user
* @return array
*/
public function getRoles(Mage_Core_Model_Abstract $user)
Expand Down Expand Up @@ -301,7 +296,6 @@ public function getRoles(Mage_Core_Model_Abstract $user)
/**
* Save user roles
*
* @param Mage_Core_Model_Abstract|Mage_Admin_Model_User $user
* @return $this
*/
public function add(Mage_Core_Model_Abstract $user)
Expand Down Expand Up @@ -346,7 +340,6 @@ public function add(Mage_Core_Model_Abstract $user)
/**
* Delete user role
*
* @param Mage_Core_Model_Abstract|Mage_Admin_Model_User $user
* @return $this
*/
public function deleteFromRole(Mage_Core_Model_Abstract $user)
Expand All @@ -372,7 +365,6 @@ public function deleteFromRole(Mage_Core_Model_Abstract $user)
/**
* Check if role user exists
*
* @param Mage_Core_Model_Abstract|Mage_Admin_Model_User $user
* @return array
*/
public function roleUserExists(Mage_Core_Model_Abstract $user)
Expand Down Expand Up @@ -400,7 +392,6 @@ public function roleUserExists(Mage_Core_Model_Abstract $user)
/**
* Check if user exists
*
* @param Mage_Core_Model_Abstract|Mage_Admin_Model_User $user
* @return array|false
*/
public function userExists(Mage_Core_Model_Abstract $user)
Expand Down Expand Up @@ -471,7 +462,6 @@ public function saveReloadAclFlag($object, $flag)
/**
* Unserializes user extra data
*
* @param Mage_Core_Model_Abstract|Mage_Admin_Model_User $user
* @return Mage_Core_Model_Abstract
*/
protected function _unserializeExtraData(Mage_Core_Model_Abstract $user)
Expand Down
1 change: 0 additions & 1 deletion app/code/core/Mage/Admin/Model/Roles.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ public function getRoleUsers()
/**
* Build resources array process
*
* @param null|Varien_Simplexml_Element $resource
* @param null|string $parentName
* @param null|int $level
* @param null|mixed $represent2Darray
Expand Down
3 changes: 1 addition & 2 deletions app/code/core/Mage/AdminNotification/Model/Inbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* @category Mage
* @package Mage_AdminNotification
* @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com)
* @copyright Copyright (c) 2019-2023 The OpenMage Contributors (https://www.openmage.org)
* @copyright Copyright (c) 2019-2024 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/

Expand Down Expand Up @@ -96,7 +96,6 @@ public function getNoticeStatus()
/**
* Parse and save new data
*
* @param array $data
* @return $this
*/
public function parse(array $data)
Expand Down
4 changes: 1 addition & 3 deletions app/code/core/Mage/AdminNotification/Model/Observer.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* @category Mage
* @package Mage_AdminNotification
* @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com)
* @copyright Copyright (c) 2020-2023 The OpenMage Contributors (https://www.openmage.org)
* @copyright Copyright (c) 2020-2024 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/

Expand All @@ -23,8 +23,6 @@ class Mage_AdminNotification_Model_Observer
{
/**
* Predispath admin action controller
*
* @param Varien_Event_Observer $observer
*/
public function preDispatch(Varien_Event_Observer $observer)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* @category Mage
* @package Mage_AdminNotification
* @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com)
* @copyright Copyright (c) 2019-2023 The OpenMage Contributors (https://www.openmage.org)
* @copyright Copyright (c) 2019-2024 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/

Expand All @@ -33,7 +33,6 @@ protected function _construct()
/**
* Load latest notice
*
* @param Mage_AdminNotification_Model_Inbox $object
* @return $this
*/
public function loadLatestNotice(Mage_AdminNotification_Model_Inbox $object)
Expand All @@ -59,7 +58,6 @@ public function loadLatestNotice(Mage_AdminNotification_Model_Inbox $object)
/**
* Get notifications grouped by severity
*
* @param Mage_AdminNotification_Model_Inbox $object
* @return array
*/
public function getNoticeStatus(Mage_AdminNotification_Model_Inbox $object)
Expand All @@ -77,9 +75,6 @@ public function getNoticeStatus(Mage_AdminNotification_Model_Inbox $object)

/**
* Save notifications (if not exists)
*
* @param Mage_AdminNotification_Model_Inbox $object
* @param array $data
*/
public function parse(Mage_AdminNotification_Model_Inbox $object, array $data)
{
Expand Down
Loading

0 comments on commit fb144ee

Please sign in to comment.