Skip to content

Commit

Permalink
Cleanup [skip ci]
Browse files Browse the repository at this point in the history
- added strict types for new classes
- added parameter & return types
- updated copyright
  • Loading branch information
sreichel committed Sep 19, 2024
1 parent d3e5c31 commit 5906117
Show file tree
Hide file tree
Showing 43 changed files with 421 additions and 602 deletions.
22 changes: 8 additions & 14 deletions app/code/core/Mage/Eav/Block/Adminhtml/Attribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,24 @@
/**
* OpenMage
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@magento.com so we can send you a copy immediately.
* It is also available at https://opensource.org/license/osl-3-0-php
*
* @category Mage
* @package Mage_Eav
* @copyright Copyright (c) 2006-2020 Magento, Inc. (http://www.magento.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* @category Mage
* @package Mage_Eav
* @copyright Copyright (c) 2024 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/

declare(strict_types=1);

/**
* Adminhtml attributes block
*
* @category Mage
* @package Mage_Eav
* @author Magento Core Team <core@magentocommerce.com>
*/

class Mage_Eav_Block_Adminhtml_Attribute extends Mage_Adminhtml_Block_Widget_Grid_Container
{
public function __construct()
Expand All @@ -41,7 +35,7 @@ public function __construct()
parent::__construct();
}

public function getHeaderCssClass()
public function getHeaderCssClass(): string
{
return 'icon-head head-eav-attribute';
}
Expand Down
30 changes: 15 additions & 15 deletions app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@
/**
* OpenMage
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@magento.com so we can send you a copy immediately.
* It is also available at https://opensource.org/license/osl-3-0-php
*
* @category Mage
* @package Mage_Eav
* @copyright Copyright (c) 2006-2020 Magento, Inc. (http://www.magento.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* @category Mage
* @package Mage_Eav
* @copyright Copyright (c) 2024 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/

declare(strict_types=1);

/**
* @category Mage
* @package Mage_Eav
*/
class Mage_Eav_Block_Adminhtml_Attribute_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
{
public function __construct()
Expand Down Expand Up @@ -48,7 +48,7 @@ public function __construct()
}
}

public function getHeaderText()
public function getHeaderText(): string
{
if (Mage::registry('entity_attribute')->getId()) {
$frontendLabel = Mage::registry('entity_attribute')->getFrontendLabel();
Expand All @@ -61,17 +61,17 @@ public function getHeaderText()
}
}

public function getValidationUrl()
public function getValidationUrl(): string
{
return $this->getUrl('*/*/validate', ['_current' => true]);
}

public function getSaveUrl()
public function getSaveUrl(): string
{
return $this->getUrl('*/*/save', ['_current' => true, 'back' => null]);
}

public function getHeaderCssClass()
public function getHeaderCssClass(): string
{
return 'icon-head head-eav-attribute';
}
Expand Down
23 changes: 12 additions & 11 deletions app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Edit/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@
/**
* OpenMage
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@magento.com so we can send you a copy immediately.
* It is also available at https://opensource.org/license/osl-3-0-php
*
* @category Mage
* @package Mage_Eav
* @copyright Copyright (c) 2006-2020 Magento, Inc. (http://www.magento.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* @category Mage
* @package Mage_Eav
* @copyright Copyright (c) 2024 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/

declare(strict_types=1);

/**
* @category Mage
* @package Mage_Eav
*/
class Mage_Eav_Block_Adminhtml_Attribute_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
{
protected function _prepareForm()
Expand All @@ -29,6 +29,7 @@ protected function _prepareForm()
]);
$form->setUseContainer(true);
$this->setForm($form);

return parent::_prepareForm();
}
}
25 changes: 13 additions & 12 deletions app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Edit/Tab/Main.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,36 @@
/**
* OpenMage
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@magento.com so we can send you a copy immediately.
* It is also available at https://opensource.org/license/osl-3-0-php
*
* @category Mage
* @package Mage_Eav
* @copyright Copyright (c) 2006-2020 Magento, Inc. (http://www.magento.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* @category Mage
* @package Mage_Eav
* @copyright Copyright (c) 2024 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/

declare(strict_types=1);

/**
* @category Mage
* @package Mage_Eav
*/
class Mage_Eav_Block_Adminhtml_Attribute_Edit_Tab_Main extends Mage_Eav_Block_Adminhtml_Attribute_Edit_Main_Abstract
{
/**
* Adding form elements for editing attribute
*
* @return $this
* @throws Mage_Core_Exception
*/
protected function _prepareForm()
{
parent::_prepareForm();
$attributeObject = $this->getAttributeObject();
$attributeTypeCode = $attributeObject->getEntityType()->getEntityTypeCode();
/* @var $form Varien_Data_Form */

$form = $this->getForm();
/* @var $fieldset Varien_Data_Form_Element_Fieldset */
$fieldset = $form->getElement('base_fieldset');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@
/**
* OpenMage
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@magento.com so we can send you a copy immediately.
* It is also available at https://opensource.org/license/osl-3-0-php
*
* @category Mage
* @package Mage_Eav
* @copyright Copyright (c) 2006-2020 Magento, Inc. (http://www.magento.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* @category Mage
* @package Mage_Eav
* @copyright Copyright (c) 2024 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/

declare(strict_types=1);

/**
* @category Mage
* @package Mage_Eav
*/
class Mage_Eav_Block_Adminhtml_Attribute_Edit_Tab_Options extends Mage_Eav_Block_Adminhtml_Attribute_Edit_Options_Abstract
{
}
22 changes: 11 additions & 11 deletions app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Edit/Tabs.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@
/**
* OpenMage
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@magento.com so we can send you a copy immediately.
* It is also available at https://opensource.org/license/osl-3-0-php
*
* @category Mage
* @package Mage_Eav
* @copyright Copyright (c) 2006-2020 Magento, Inc. (http://www.magento.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* @category Mage
* @package Mage_Eav
* @copyright Copyright (c) 2024 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/

declare(strict_types=1);

/**
* @category Mage
* @package Mage_Eav
*/
class Mage_Eav_Block_Adminhtml_Attribute_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
{
public function __construct()
Expand Down
24 changes: 13 additions & 11 deletions app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Grid.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,29 @@
/**
* OpenMage
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@magento.com so we can send you a copy immediately.
* It is also available at https://opensource.org/license/osl-3-0-php
*
* @category Mage
* @package Mage_Eav
* @copyright Copyright (c) 2006-2020 Magento, Inc. (http://www.magento.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* @category Mage
* @package Mage_Eav
* @copyright Copyright (c) 2024 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/

declare(strict_types=1);

/**
* @category Mage
* @package Mage_Eav
*/
class Mage_Eav_Block_Adminhtml_Attribute_Grid extends Mage_Eav_Block_Adminhtml_Attribute_Grid_Abstract
{
/**
* Prepare grid collection object
*
* @return $this
* @throws Exception
*/
protected function _prepareCollection()
{
Expand All @@ -40,6 +41,7 @@ protected function _prepareCollection()
* Prepare attributes grid columns
*
* @return $this
* @throws Exception
*/
protected function _prepareColumns()
{
Expand Down
24 changes: 9 additions & 15 deletions app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Set.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,24 @@
/**
* OpenMage
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@magento.com so we can send you a copy immediately.
* It is also available at https://opensource.org/license/osl-3-0-php
*
* @category Mage
* @package Mage_Eav
* @copyright Copyright (c) 2006-2020 Magento, Inc. (http://www.magento.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* @category Mage
* @package Mage_Eav
* @copyright Copyright (c) 2024 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/

declare(strict_types=1);

/**
* Adminhtml attribute sets block
*
* @category Mage
* @package Mage_Eav
* @author Magento Core Team <core@magentocommerce.com>
*/

class Mage_Eav_Block_Adminhtml_Attribute_Set extends Mage_Adminhtml_Block_Widget_Grid_Container
{
public function __construct()
Expand All @@ -41,12 +35,12 @@ public function __construct()
parent::__construct();
}

public function getCreateUrl()
public function getCreateUrl(): string
{
return $this->getUrl('*/*/add');
}

public function getHeaderCssClass()
public function getHeaderCssClass(): string
{
return 'icon-head head-eav-attribute-sets';
}
Expand Down
Loading

0 comments on commit 5906117

Please sign in to comment.