apply code style rules

Cette révision appartient à :
Daniel Seifert 2022-07-27 08:47:20 +02:00
Parent 00e54ec4dc
révision 72fcd89823
Signé par: DanielS
ID de la clé GPG: 8A7C4C6ED1915C6F
7 fichiers modifiés avec 28 ajouts et 27 suppressions

1
.gitignore externe Fichier normal
Voir le fichier

@ -0,0 +1 @@
.php_cs.cache

Voir le fichier

@ -6,7 +6,7 @@ $finder = PhpCsFixer\Finder::create()
$config = new PhpCsFixer\Config();
return $config->setRules([
'@PHP70Migration' => true,
'@PHP71Migration' => true,
'@PSR12' => true
])
->setFinder($finder)

Voir le fichier

@ -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

Voir le fichier

@ -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);
}
}

Voir le fichier

@ -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;
}

Voir le fichier

@ -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')]);
}
}

Voir le fichier

@ -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')]);
}
}