improve code
Cette révision appartient à :
Parent
0dbd956a68
révision
d6a2373c31
@ -18,6 +18,7 @@ namespace D3\MailConfigChecker\Application\Controller\Admin;
|
||||
use Assert\Assert;
|
||||
use D3\MailConfigChecker\Application\Model\Exception\d3TranslatableLazyAssertionException;
|
||||
use OxidEsales\Eshop\Application\Controller\Admin\AdminDetailsController;
|
||||
use OxidEsales\Eshop\Application\Model\Shop;
|
||||
use OxidEsales\Eshop\Core\Email;
|
||||
use OxidEsales\Eshop\Core\Registry;
|
||||
|
||||
@ -78,6 +79,7 @@ class MailTester extends AdminDetailsController
|
||||
|
||||
public function getMailAddressList()
|
||||
{
|
||||
/** @var Shop $shop */
|
||||
$shop = Registry::getConfig()->getActiveShop();
|
||||
|
||||
return array_filter(
|
||||
|
@ -52,9 +52,9 @@ class SmtpChecker extends AdminDetailsController
|
||||
list( 'host' => $shopHost, 'port' => $shopPort ) = parse_url( trim($activeShop->getFieldData( 'oxsmtp' )) );
|
||||
}
|
||||
|
||||
$this->host = $shopHost ?? null;
|
||||
$this->host = $shopHost;
|
||||
$this->addTplParam('smtpHost', Registry::getRequest()->getRequestEscapedParameter('smtpHost'));
|
||||
$this->port = $shopPort ?? null;
|
||||
$this->port = $shopPort;
|
||||
$this->user = Registry::getRequest()->getRequestEscapedParameter('smtpUser') ?: $activeShop->getFieldData('oxsmtpuser');
|
||||
$this->addTplParam('smtpUser', $this->user);
|
||||
$this->pwd = Registry::getRequest()->getRequestEscapedParameter('smtpPwd') ?: $activeShop->getFieldData('oxsmtppwd');
|
||||
@ -82,6 +82,7 @@ class SmtpChecker extends AdminDetailsController
|
||||
|
||||
public function getMailAddressList()
|
||||
{
|
||||
/** @var Shop $shop */
|
||||
$shop = Registry::getConfig()->getActiveShop();
|
||||
|
||||
return array_filter(
|
||||
|
@ -22,6 +22,7 @@ use Mika56\SPFCheck\Model\Query;
|
||||
use Mika56\SPFCheck\Model\Result;
|
||||
use Mika56\SPFCheck\SPFCheck;
|
||||
use OxidEsales\Eshop\Application\Controller\Admin\AdminDetailsController;
|
||||
use OxidEsales\Eshop\Application\Model\Shop;
|
||||
use OxidEsales\Eshop\Core\Registry;
|
||||
|
||||
class SpfChecker extends AdminDetailsController
|
||||
@ -50,6 +51,9 @@ class SpfChecker extends AdminDetailsController
|
||||
|
||||
protected function getMailDomains()
|
||||
{
|
||||
/** @var Shop $shop */
|
||||
$shop = Registry::getConfig()->getActiveShop();
|
||||
|
||||
return
|
||||
array_filter(
|
||||
array_unique(
|
||||
@ -68,9 +72,9 @@ class SpfChecker extends AdminDetailsController
|
||||
}
|
||||
},
|
||||
[
|
||||
Registry::getConfig()->getActiveShop()->getFieldData('oxinfoemail'),
|
||||
Registry::getConfig()->getActiveShop()->getFieldData('oxorderemail'),
|
||||
Registry::getConfig()->getActiveShop()->getFieldData('oxowneremail'),
|
||||
$shop->getFieldData('oxinfoemail'),
|
||||
$shop->getFieldData('oxorderemail'),
|
||||
$shop->getFieldData('oxowneremail'),
|
||||
]
|
||||
)
|
||||
)
|
||||
|
@ -30,6 +30,6 @@ class d3TranslatableLazyAssertionException extends LazyAssertionException
|
||||
$message .= sprintf( "%d) %s: %s\n", $i ++, $error->getPropertyPath(), $error->getMessage() );
|
||||
}
|
||||
|
||||
return new static($message, $errors);
|
||||
return new LazyAssertionException($message, $errors);
|
||||
}
|
||||
}
|
10
phpstan.neon
10
phpstan.neon
@ -1,10 +1,10 @@
|
||||
parameters:
|
||||
scanFiles:
|
||||
- IntelliSenseHelper.php
|
||||
- ../../oxid-esales/oxideshop-ce/source/oxfunctions.php
|
||||
- ../../oxid-esales/oxideshop-ce/source/overridablefunctions.php
|
||||
level: 9
|
||||
phpVersion: 70100
|
||||
paths:
|
||||
- .
|
||||
level: 4
|
||||
phpVersion: 70300
|
||||
checkMissingIterableValueType: false
|
||||
ignoreErrors:
|
||||
- '#Psr\\Container\\ContainerExceptionInterface is not subtype of Throwable#'
|
||||
|
||||
|
Chargement…
Référencer dans un nouveau ticket
Block a user