clean code
This commit is contained in:
parent
6d947f6d6e
commit
08db1ea34a
@ -19,13 +19,11 @@ use D3\Linkmobility4OXID\Application\Model\Exceptions\noRecipientFoundException;
|
||||
use D3\Linkmobility4OXID\Application\Model\Exceptions\successfullySentException;
|
||||
use D3\Linkmobility4OXID\Application\Model\OrderRecipients;
|
||||
use D3\Linkmobility4OXID\Application\Model\Sms;
|
||||
use D3\Linkmobility4OXID\Application\Model\UserRecipients;
|
||||
use D3\LinkmobilityClient\ValueObject\Recipient;
|
||||
use Exception;
|
||||
use OxidEsales\Eshop\Application\Controller\Admin\AdminController;
|
||||
use OxidEsales\Eshop\Application\Model\Order;
|
||||
use OxidEsales\Eshop\Application\Model\Remark;
|
||||
use OxidEsales\Eshop\Application\Model\User;
|
||||
use OxidEsales\Eshop\Core\Registry;
|
||||
|
||||
class AdminOrder extends AdminController
|
||||
|
@ -15,10 +15,11 @@
|
||||
|
||||
namespace D3\Linkmobility4OXID\Application\Model\Exceptions;
|
||||
|
||||
use Exception;
|
||||
use OxidEsales\Eshop\Core\Registry;
|
||||
use Throwable;
|
||||
|
||||
class successfullySentException extends \Exception
|
||||
class successfullySentException extends Exception
|
||||
{
|
||||
/**
|
||||
* @param int $messageCount
|
||||
|
@ -17,10 +17,6 @@ namespace D3\Linkmobility4OXID\Application\Model;
|
||||
|
||||
use D3\Linkmobility4OXID\Application\Controller\Admin\AdminUser;
|
||||
use D3\Linkmobility4OXID\Application\Model\Exceptions\noRecipientFoundException;
|
||||
use D3\LinkmobilityClient\Client;
|
||||
use D3\LinkmobilityClient\Request\RequestInterface;
|
||||
use D3\LinkmobilityClient\ValueObject\Sender;
|
||||
use Exception;
|
||||
use OxidEsales\Eshop\Application\Model\Order;
|
||||
use OxidEsales\Eshop\Application\Model\Remark;
|
||||
use OxidEsales\Eshop\Core\Registry;
|
||||
@ -30,8 +26,6 @@ class MessageSender
|
||||
/**
|
||||
* @param Order $order
|
||||
* @param $messageBody
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
public function sendOrderFinishedMessage(Order $order, $messageBody)
|
||||
{
|
||||
@ -41,8 +35,6 @@ class MessageSender
|
||||
/**
|
||||
* @param Order $order
|
||||
* @param $messageBody
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
public function sendSendedNowMessage(Order $order, $messageBody)
|
||||
{
|
||||
@ -52,14 +44,17 @@ class MessageSender
|
||||
/**
|
||||
* @param Order $order
|
||||
* @param $messageBody
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
public function sendCancelOrderMessage(Order $order, $messageBody)
|
||||
{
|
||||
$this->sendMessageByOrder('d3linkmobility_cancelOrderActive', $order, $messageBody);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $configParam
|
||||
* @param Order $order
|
||||
* @param $messageBody
|
||||
*/
|
||||
public function sendMessageByOrder($configParam, Order $order, $messageBody)
|
||||
{
|
||||
if (false === (bool) Registry::getConfig()->getConfigParam($configParam)
|
||||
@ -79,8 +74,6 @@ class MessageSender
|
||||
/**
|
||||
* @param $orderId
|
||||
* @param $message
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
protected function setRemark($orderId, $recipients, $message)
|
||||
{
|
||||
|
@ -19,7 +19,6 @@ use D3\Linkmobility4OXID\Application\Model\Exceptions\noRecipientFoundException;
|
||||
use D3\LinkmobilityClient\ValueObject\Recipient;
|
||||
use OxidEsales\Eshop\Application\Model\Country;
|
||||
use OxidEsales\Eshop\Application\Model\Order;
|
||||
use OxidEsales\Eshop\Application\Model\User;
|
||||
use OxidEsales\Eshop\Core\Registry;
|
||||
|
||||
class OrderRecipients
|
||||
|
@ -17,7 +17,6 @@ namespace D3\Linkmobility4OXID\Application\Model;
|
||||
|
||||
use D3\Linkmobility4OXID\Application\Model\Exceptions\abortSendingExceptionInterface;
|
||||
use D3\Linkmobility4OXID\Application\Model\Exceptions\noRecipientFoundException;
|
||||
use D3\Linkmobility4OXID\Application\Model\RequestFactory;
|
||||
use D3\LinkmobilityClient\Exceptions\ApiException;
|
||||
use D3\LinkmobilityClient\Request\RequestInterface;
|
||||
use D3\LinkmobilityClient\Response\ResponseInterface;
|
||||
@ -25,6 +24,7 @@ use D3\LinkmobilityClient\SMS\SmsRequestInterface;
|
||||
use D3\LinkmobilityClient\ValueObject\Recipient;
|
||||
use D3\LinkmobilityClient\ValueObject\Sender;
|
||||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use InvalidArgumentException;
|
||||
use OxidEsales\Eshop\Application\Model\Order;
|
||||
use OxidEsales\Eshop\Application\Model\User;
|
||||
use OxidEsales\Eshop\Core\Registry;
|
||||
@ -69,12 +69,6 @@ class Sms
|
||||
*/
|
||||
public function sendOrderMessage(Order $order): bool
|
||||
{
|
||||
try {
|
||||
oxNew( OrderRecipients::class, $order )->getSmsRecipient();
|
||||
} catch (Exception $e) {
|
||||
dumpvar($e->getMessage());
|
||||
}
|
||||
|
||||
try {
|
||||
Registry::getLogger()->debug('startRequest', ['orderId' => $order->getId()]);
|
||||
$return = $this->sendCustomRecipientMessage(
|
||||
@ -135,7 +129,7 @@ class Sms
|
||||
} catch (ApiException $e) {
|
||||
Registry::getLogger()->warning($e->getMessage());
|
||||
Registry::getUtilsView()->addErrorToDisplay($e);
|
||||
} catch (\InvalidArgumentException $e) {
|
||||
} catch ( InvalidArgumentException $e) {
|
||||
Registry::getLogger()->warning($e->getMessage());
|
||||
Registry::getUtilsView()->addErrorToDisplay($e);
|
||||
}
|
||||
|
@ -82,8 +82,6 @@ class UserRecipients
|
||||
|
||||
/**
|
||||
* @param $checkFieldName
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function checkFieldExists(&$checkFieldName)
|
||||
{
|
||||
|
@ -13,11 +13,11 @@
|
||||
<input type="hidden" name="fnc" value="">
|
||||
<input type="hidden" name="oxid" value="[{$oxid}]">
|
||||
|
||||
<table cellspacing="0" cellpadding="0" border="0" width="98%">
|
||||
<table style="border: 0; width: 98%; padding: 0; border-spacing: 0">
|
||||
<tr>
|
||||
<!-- Anfang linke Seite -->
|
||||
<td valign="top" class="edittext" align="left" width="100%">
|
||||
<table cellspacing="0" cellpadding="0" border="0">
|
||||
<td style="text-align: left; width: 100%; vertical-align: top;" class="edittext">
|
||||
<table style="border: 0; padding: 0; border-spacing: 0">
|
||||
<tr>
|
||||
<td class="edittext">
|
||||
<label for="recipient">[{oxmultilang ident="D3LM_ADMIN_USER_RECIPIENT"}]</label>
|
||||
|
@ -13,13 +13,6 @@
|
||||
* @link http://www.oxidmodule.com
|
||||
*/
|
||||
|
||||
namespace D3\Linkmobility4OXID\Modules\Application\Controller
|
||||
{
|
||||
class ContactController_parent extends ContactController {}
|
||||
|
||||
class StartController_parent extends StartController {}
|
||||
}
|
||||
|
||||
namespace D3\Linkmobility4OXID\Modules\Aplication\Model {
|
||||
|
||||
use OxidEsales\Eshop\Application\Model\Order;
|
||||
|
@ -15,7 +15,6 @@
|
||||
|
||||
namespace D3\Linkmobility4OXID\Modules\Application\Model;
|
||||
|
||||
use D3\Linkmobility4OXID\Application\Model\MessageSender;
|
||||
use OxidEsales\Eshop\Core\Email;
|
||||
|
||||
class OrderModel extends OrderModel_parent
|
||||
|
@ -18,6 +18,7 @@ namespace D3\Linkmobility4OXID\Modules\Core;
|
||||
use D3\Linkmobility4OXID\Application\Model\MessageSender;
|
||||
use Exception;
|
||||
use OxidEsales\Eshop\Application\Model\Order;
|
||||
use OxidEsales\EshopCommunity\Internal\Container\ContainerFactory;
|
||||
use OxidEsales\EshopCommunity\Internal\Framework\Templating\TemplateRendererBridgeInterface;
|
||||
use OxidEsales\EshopCommunity\Internal\Framework\Templating\TemplateRendererInterface;
|
||||
|
||||
@ -59,8 +60,6 @@ class EmailCore extends EmailCore_parent
|
||||
|
||||
/**
|
||||
* @param Order $order
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
public function d3SendOrderFinishedMessageToUser(Order $order)
|
||||
{
|
||||
@ -131,7 +130,7 @@ class EmailCore extends EmailCore_parent
|
||||
*/
|
||||
protected function d3GetTplRenderer() : TemplateRendererInterface
|
||||
{
|
||||
$bridge = \OxidEsales\EshopCommunity\Internal\Container\ContainerFactory::getInstance()->getContainer()
|
||||
$bridge = ContainerFactory::getInstance()->getContainer()
|
||||
->get(TemplateRendererBridgeInterface::class);
|
||||
$bridge->setEngine($this->_getSmarty());
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user