diff --git a/Application/Controller/Admin/MailTester.php b/Application/Controller/Admin/MailTester.php index 9c1eb5f..fb7fd24 100644 --- a/Application/Controller/Admin/MailTester.php +++ b/Application/Controller/Admin/MailTester.php @@ -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( diff --git a/Application/Controller/Admin/SmtpChecker.php b/Application/Controller/Admin/SmtpChecker.php index 5de4814..9c7c8ec 100644 --- a/Application/Controller/Admin/SmtpChecker.php +++ b/Application/Controller/Admin/SmtpChecker.php @@ -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( diff --git a/Application/Controller/Admin/SpfChecker.php b/Application/Controller/Admin/SpfChecker.php index 162ba80..7abeac6 100644 --- a/Application/Controller/Admin/SpfChecker.php +++ b/Application/Controller/Admin/SpfChecker.php @@ -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'), ] ) ) diff --git a/Application/Model/Exception/d3TranslatableLazyAssertionException.php b/Application/Model/Exception/d3TranslatableLazyAssertionException.php index 7295443..98afa37 100644 --- a/Application/Model/Exception/d3TranslatableLazyAssertionException.php +++ b/Application/Model/Exception/d3TranslatableLazyAssertionException.php @@ -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); } } \ No newline at end of file diff --git a/phpstan.neon b/phpstan.neon index b6e0779..a96a261 100644 --- a/phpstan.neon +++ b/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#' +