apply code style rules
This commit is contained in:
parent
00e54ec4dc
commit
72fcd89823
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
.php_cs.cache
|
@ -6,7 +6,7 @@ $finder = PhpCsFixer\Finder::create()
|
||||
|
||||
$config = new PhpCsFixer\Config();
|
||||
return $config->setRules([
|
||||
'@PHP70Migration' => true,
|
||||
'@PHP71Migration' => true,
|
||||
'@PSR12' => true
|
||||
])
|
||||
->setFinder($finder)
|
||||
|
@ -22,21 +22,21 @@ use OxidEsales\Eshop\Core\Registry;
|
||||
|
||||
class Configuration
|
||||
{
|
||||
const GENERAL_APITOKEN = "d3linkmobility_apitoken";
|
||||
const GENERAL_DEBUG = "d3linkmobility_debug";
|
||||
public const GENERAL_APITOKEN = "d3linkmobility_apitoken";
|
||||
public const GENERAL_DEBUG = "d3linkmobility_debug";
|
||||
|
||||
const ORDER_RECFIELDS = "d3linkmobility_smsOrderRecipientsFields";
|
||||
const USER_RECFIELDS = "d3linkmobility_smsUserRecipientsFields";
|
||||
public const ORDER_RECFIELDS = "d3linkmobility_smsOrderRecipientsFields";
|
||||
public const USER_RECFIELDS = "d3linkmobility_smsUserRecipientsFields";
|
||||
|
||||
const SMS_SENDERNR = "d3linkmobility_smsSenderNumber";
|
||||
const SMS_SENDERCOUNTRY = "d3linkmobility_smsSenderCountry";
|
||||
public const SMS_SENDERNR = "d3linkmobility_smsSenderNumber";
|
||||
public const SMS_SENDERCOUNTRY = "d3linkmobility_smsSenderCountry";
|
||||
|
||||
const SENDBY_ORDERED = "d3linkmobility_orderActive";
|
||||
const SENDBY_SENDEDNOW = "d3linkmobility_sendedNowActive";
|
||||
const SENDBY_CANCELED = "d3linkmobility_cancelOrderActive";
|
||||
public const SENDBY_ORDERED = "d3linkmobility_orderActive";
|
||||
public const SENDBY_SENDEDNOW = "d3linkmobility_sendedNowActive";
|
||||
public const SENDBY_CANCELED = "d3linkmobility_cancelOrderActive";
|
||||
|
||||
const ARGS_CHECKKEYS = "checkKeys";
|
||||
const ARGS_CHECKCLASS = "checkClassName";
|
||||
public const ARGS_CHECKKEYS = "checkKeys";
|
||||
public const ARGS_CHECKCLASS = "checkClassName";
|
||||
|
||||
/**
|
||||
* @return string
|
||||
|
@ -30,7 +30,7 @@ class MessageSender
|
||||
public function sendOrderFinishedMessage(Order $order, $messageBody)
|
||||
{
|
||||
if ((oxNew(Configuration::class))->sendOrderFinishedMessage()) {
|
||||
$this->sendMessageByOrder( $order, $messageBody);
|
||||
$this->sendMessageByOrder($order, $messageBody);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -22,7 +22,7 @@ use OxidEsales\Eshop\Application\Model\Remark;
|
||||
|
||||
abstract class AbstractMessage
|
||||
{
|
||||
const REMARK_IDENT = 'LINKMOB';
|
||||
public const REMARK_IDENT = 'LINKMOB';
|
||||
|
||||
protected $message;
|
||||
protected $removeLineBreaks = true;
|
||||
@ -109,5 +109,5 @@ abstract class AbstractMessage
|
||||
return $this->removeMultipleSpaces ? preg_replace($regexp, ' ', $message) : $message;
|
||||
}
|
||||
|
||||
abstract public function getTypeName() : string;
|
||||
abstract public function getTypeName(): string;
|
||||
}
|
||||
|
@ -43,17 +43,17 @@ class OrderRecipients
|
||||
{
|
||||
foreach ($this->getSmsRecipientFields() as $phoneFieldName => $countryIdFieldName) {
|
||||
$content = trim((string) $this->order->getFieldData($phoneFieldName));
|
||||
$country = oxNew( Country::class );
|
||||
$country = oxNew(Country::class);
|
||||
|
||||
try {
|
||||
if ( strlen( $content ) ) {
|
||||
$country->load( $this->order->getFieldData( $countryIdFieldName ) );
|
||||
return oxNew( Recipient::class, $content, $country->getFieldData( 'oxisoalpha2' ) );
|
||||
if (strlen($content)) {
|
||||
$country->load($this->order->getFieldData($countryIdFieldName));
|
||||
return oxNew(Recipient::class, $content, $country->getFieldData('oxisoalpha2'));
|
||||
}
|
||||
} catch (NumberParseException $e) {
|
||||
LoggerHandler::getInstance()->getLogger()->info($e->getMessage(), [$content, $country->getFieldData( 'oxisoalpha2' )]);
|
||||
LoggerHandler::getInstance()->getLogger()->info($e->getMessage(), [$content, $country->getFieldData('oxisoalpha2')]);
|
||||
} catch (RecipientException $e) {
|
||||
LoggerHandler::getInstance()->getLogger()->info($e->getMessage(), [$content, $country->getFieldData( 'oxisoalpha2' )]);
|
||||
LoggerHandler::getInstance()->getLogger()->info($e->getMessage(), [$content, $country->getFieldData('oxisoalpha2')]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -43,17 +43,17 @@ class UserRecipients
|
||||
{
|
||||
foreach ($this->getSmsRecipientFields() as $fieldName) {
|
||||
$content = trim($this->user->getFieldData($fieldName));
|
||||
$country = oxNew( Country::class );
|
||||
$country = oxNew(Country::class);
|
||||
|
||||
try {
|
||||
if ( strlen( $content ) ) {
|
||||
$country->load( $this->user->getFieldData( 'oxcountryid' ) );
|
||||
return oxNew( Recipient::class, $content, $country->getFieldData( 'oxisoalpha2' ) );
|
||||
if (strlen($content)) {
|
||||
$country->load($this->user->getFieldData('oxcountryid'));
|
||||
return oxNew(Recipient::class, $content, $country->getFieldData('oxisoalpha2'));
|
||||
}
|
||||
} catch (NumberParseException $e) {
|
||||
LoggerHandler::getInstance()->getLogger()->info($e->getMessage(), [$content, $country->getFieldData( 'oxisoalpha2' )]);
|
||||
LoggerHandler::getInstance()->getLogger()->info($e->getMessage(), [$content, $country->getFieldData('oxisoalpha2')]);
|
||||
} catch (RecipientException $e) {
|
||||
LoggerHandler::getInstance()->getLogger()->info($e->getMessage(), [$content, $country->getFieldData( 'oxisoalpha2' )]);
|
||||
LoggerHandler::getInstance()->getLogger()->info($e->getMessage(), [$content, $country->getFieldData('oxisoalpha2')]);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user