code cleanup

This commit is contained in:
AntonHeinze 2024-12-19 16:28:29 +01:00
parent 889f721279
commit ba123ad789
7 changed files with 31 additions and 31 deletions

View File

@ -17,11 +17,12 @@ declare(strict_types=1);
namespace D3\ManufacturerInformation\Application\Controller\Admin;
use D3\ManufacturerInformation\Application\Model\Constants;
use D3\ManufacturerInformation\Modules\Application\Model\D3ManufacturerLongDesc;
use Exception;
use OxidEsales\Eshop\Application\Controller\Admin\AdminDetailsController;
use OxidEsales\Eshop\Application\Model\Manufacturer;
use OxidEsales\Eshop\Core\Registry;
use stdClass;
class ManufacturerInfoLongdesc extends AdminDetailsController
{
@ -33,12 +34,12 @@ class ManufacturerInfoLongdesc extends AdminDetailsController
parent::render();
/** @var Manufacturer|D3ManufacturerLongDesc $oManufacturer */
$this->_aViewData['edit'] = $oManufacturer = oxNew(\OxidEsales\Eshop\Application\Model\Manufacturer::class);
$this->_aViewData['edit'] = $oManufacturer = oxNew(Manufacturer::class);
$sOXID = $this->_aViewData["oxid"] = $this->getEditObjectId();
if (isset($sOXID) && $sOXID != "-1") {
// load object
$d3manufacturerlang = \OxidEsales\Eshop\Core\Registry::getRequest()->getRequestEscapedParameter("catlang");
$d3manufacturerlang = Registry::getRequest()->getRequestEscapedParameter("catlang");
if (!isset($d3manufacturerlang)) {
$d3manufacturerlang = $this->_iEditLang;
@ -53,8 +54,8 @@ class ManufacturerInfoLongdesc extends AdminDetailsController
$this->_aViewData['readonly'] = true;
}
foreach (\OxidEsales\Eshop\Core\Registry::getLang()->getLanguageNames() as $id => $language) {
$oLang = new \stdClass();
foreach (Registry::getLang()->getLanguageNames() as $id => $language) {
$oLang = new stdClass();
$oLang->sLangDesc = $language;
$oLang->selected = ($id == $this->_iEditLang);
$this->_aViewData["otherlang"][$id] = clone $oLang;
@ -68,13 +69,13 @@ class ManufacturerInfoLongdesc extends AdminDetailsController
/**
* @return void
* @throws \Exception
* @throws Exception
*/
public function save()
public function save(): void
{
parent::save();
$iManufacturerLang = intval(\OxidEsales\Eshop\Core\Registry::getRequest()->getRequestEscapedParameter("catlang"));
$iManufacturerLang = intval(Registry::getRequest()->getRequestEscapedParameter("catlang"));
$sOXID = $this->getEditObjectId();
$this->setEditObjectId($sOXID);
@ -115,7 +116,7 @@ class ManufacturerInfoLongdesc extends AdminDetailsController
*
* @return mixed
*/
protected function processLongDesc($sValue)
protected function processLongDesc($sValue): mixed
{
$aSearch = ['&amp;nbsp;', '&amp;', '&quot;', '&lang=', '<p>&nbsp;</p>', '<p>&nbsp; </p>'];
$aReplace = ['&nbsp;', '&', '"', '&amp;lang=', '', ''];

View File

@ -18,7 +18,6 @@ declare(strict_types=1);
namespace D3\ManufacturerInformation\Modules\Application\Model;
use D3\ManufacturerInformation\Application\Model\Constants;
use OxidEsales\Eshop\Application\Model\Manufacturer;
use OxidEsales\Eshop\Core\Field;
use OxidEsales\Eshop\Core\Registry;

View File

@ -33,7 +33,7 @@ class ManufacturerInfoList extends ManufacturerInfoList_parent
* @param Manufacturer|D3ManufacturerLongDesc $oManufacturer
* @return void
*/
protected function addCategoryFields($oManufacturer)
protected function addCategoryFields($oManufacturer): void
{
parent::addCategoryFields($oManufacturer);