fix code style
This commit is contained in:
parent
42cf5721ce
commit
817f9e68a2
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
.php_cs.cache
|
12
.php-cs-fixer.php
Normal file
12
.php-cs-fixer.php
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
$finder = PhpCsFixer\Finder::create()
|
||||||
|
->in(__DIR__)
|
||||||
|
;
|
||||||
|
|
||||||
|
$config = new PhpCsFixer\Config();
|
||||||
|
return $config->setRules([
|
||||||
|
'@PHP73Migration' => true,
|
||||||
|
'@PSR12' => true
|
||||||
|
])
|
||||||
|
->setFinder($finder);
|
@ -36,6 +36,10 @@
|
|||||||
"d3/ordermanager": "^5.0",
|
"d3/ordermanager": "^5.0",
|
||||||
"d3/linkmobility4oxid": "^1.0"
|
"d3/linkmobility4oxid": "^1.0"
|
||||||
},
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"php": "^7.4",
|
||||||
|
"friendsofphp/php-cs-fixer": "^3.9"
|
||||||
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
"D3\\Linkmobility4Ordermanager\\": "../../../source/modules/d3/linkmobility4ordermanager"
|
"D3\\Linkmobility4Ordermanager\\": "../../../source/modules/d3/linkmobility4ordermanager"
|
||||||
|
@ -38,28 +38,28 @@ use OxidEsales\Eshop\Core\Registry;
|
|||||||
class d3linkmobility_ordermanager_action extends d3ordermanager_action_abstract
|
class d3linkmobility_ordermanager_action extends d3ordermanager_action_abstract
|
||||||
{
|
{
|
||||||
public $sTplName = 'd3linkmobility_ordermanager_action.tpl';
|
public $sTplName = 'd3linkmobility_ordermanager_action.tpl';
|
||||||
CONST ACTIVE_SWITCH = 'blActionLinkmobility_status';
|
public const ACTIVE_SWITCH = 'blActionLinkmobility_status';
|
||||||
public $sTitleIdent = 'D3_LINKMOBILITY_ORDERMANAGER_ACTION';
|
public $sTitleIdent = 'D3_LINKMOBILITY_ORDERMANAGER_ACTION';
|
||||||
|
|
||||||
CONST SOURCE_TEMPLATE = 'template';
|
public const SOURCE_TEMPLATE = 'template';
|
||||||
CONST SOURCE_CMS = 'cms';
|
public const SOURCE_CMS = 'cms';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public final function isAllowedInEditions(): array
|
final public function isAllowedInEditions(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
d3ordermanager_conf::SERIAL_BIT_FREE_EDITION,
|
d3ordermanager_conf::SERIAL_BIT_FREE_EDITION,
|
||||||
d3ordermanager_conf::SERIAL_BIT_STANDARD_EDITION,
|
d3ordermanager_conf::SERIAL_BIT_STANDARD_EDITION,
|
||||||
d3ordermanager_conf::SERIAL_BIT_PREMIUM_EDITION
|
d3ordermanager_conf::SERIAL_BIT_PREMIUM_EDITION,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function getUnvalidConfigurationMessageIdent() : string
|
public function getUnvalidConfigurationMessageIdent(): string
|
||||||
{
|
{
|
||||||
if ($this->hasRequiredValuesNoSource(false)) {
|
if ($this->hasRequiredValuesNoSource(false)) {
|
||||||
return 'D3_ORDERMANAGER_ACTION_LINKMOBILITYMESSAGE_ERR_NOVALIDSOURCE';
|
return 'D3_ORDERMANAGER_ACTION_LINKMOBILITYMESSAGE_ERR_NOVALIDSOURCE';
|
||||||
@ -117,7 +117,8 @@ class d3linkmobility_ordermanager_action extends d3ordermanager_action_abstract
|
|||||||
{
|
{
|
||||||
$aMailDesc = [];
|
$aMailDesc = [];
|
||||||
($this->getManager()->getValue('blLinkMobilityMessageToCustomer') ? $aMailDesc[] = 'Customer' : '');
|
($this->getManager()->getValue('blLinkMobilityMessageToCustomer') ? $aMailDesc[] = 'Customer' : '');
|
||||||
($this->getManager()->getValue('blLinkMobilityMessageToCustom') ?
|
(
|
||||||
|
$this->getManager()->getValue('blLinkMobilityMessageToCustom') ?
|
||||||
$aMailDesc[] = 'Custom: ' . $this->getManager()->getValue('sLinkMobilityMessageToCustomAddress') :
|
$aMailDesc[] = 'Custom: ' . $this->getManager()->getValue('sLinkMobilityMessageToCustomAddress') :
|
||||||
''
|
''
|
||||||
);
|
);
|
||||||
@ -144,7 +145,7 @@ class d3linkmobility_ordermanager_action extends d3ordermanager_action_abstract
|
|||||||
*/
|
*/
|
||||||
protected function hasRequiredValuesNoSource(bool $blExpected): bool
|
protected function hasRequiredValuesNoSource(bool $blExpected): bool
|
||||||
{
|
{
|
||||||
$source = (string) $this->getManager()->getValue( 'sLinkMobilityMessageFromSource' );
|
$source = (string) $this->getManager()->getValue('sLinkMobilityMessageFromSource');
|
||||||
|
|
||||||
$return = strlen(trim($source)) &&
|
$return = strlen(trim($source)) &&
|
||||||
in_array(trim($source), [self::SOURCE_CMS, self::SOURCE_TEMPLATE]);
|
in_array(trim($source), [self::SOURCE_CMS, self::SOURCE_TEMPLATE]);
|
||||||
@ -159,21 +160,21 @@ class d3linkmobility_ordermanager_action extends d3ordermanager_action_abstract
|
|||||||
*/
|
*/
|
||||||
protected function hasRequiredValuesTplSource(bool $blExpected): bool
|
protected function hasRequiredValuesTplSource(bool $blExpected): bool
|
||||||
{
|
{
|
||||||
$source = (string) $this->getManager()->getValue( 'sLinkMobilityMessageFromSource' );
|
$source = (string) $this->getManager()->getValue('sLinkMobilityMessageFromSource');
|
||||||
|
|
||||||
if (trim($source) !== self::SOURCE_TEMPLATE) {
|
if (trim($source) !== self::SOURCE_TEMPLATE) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$template = (string) $this->getManager()->getValue( 'sLinkMobilityMessageFromTemplatename' );
|
$template = (string) $this->getManager()->getValue('sLinkMobilityMessageFromTemplatename');
|
||||||
$theme = (string) $this->getManager()->getValue( 'sLinkMobilityMessageFromTheme' );
|
$theme = (string) $this->getManager()->getValue('sLinkMobilityMessageFromTheme');
|
||||||
|
|
||||||
if ($blExpected === true) {
|
if ($blExpected === true) {
|
||||||
return (bool) strlen( trim( $template ) ) === true &&
|
return (bool) strlen(trim($template)) === true &&
|
||||||
(bool) strlen( trim( $theme ) ) === true;
|
(bool) strlen(trim($theme)) === true;
|
||||||
} else {
|
} else {
|
||||||
return (bool) strlen( trim( $template ) ) === false ||
|
return (bool) strlen(trim($template)) === false ||
|
||||||
(bool) strlen( trim( $theme ) ) === false;
|
(bool) strlen(trim($theme)) === false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -184,7 +185,7 @@ class d3linkmobility_ordermanager_action extends d3ordermanager_action_abstract
|
|||||||
*/
|
*/
|
||||||
protected function hasRequiredValuesCmsSource(bool $blExpected): bool
|
protected function hasRequiredValuesCmsSource(bool $blExpected): bool
|
||||||
{
|
{
|
||||||
$source = (string) $this->getManager()->getValue( 'sLinkMobilityMessageFromSource' );
|
$source = (string) $this->getManager()->getValue('sLinkMobilityMessageFromSource');
|
||||||
|
|
||||||
if (trim($source) !== self::SOURCE_CMS) {
|
if (trim($source) !== self::SOURCE_CMS) {
|
||||||
return false;
|
return false;
|
||||||
@ -192,14 +193,14 @@ class d3linkmobility_ordermanager_action extends d3ordermanager_action_abstract
|
|||||||
|
|
||||||
/** @var Content $content */
|
/** @var Content $content */
|
||||||
$content = oxNew(Content::class);
|
$content = oxNew(Content::class);
|
||||||
$contentname = (string) $this->getManager()->getValue( 'sLinkMobilityMessageFromContentname' );
|
$contentname = (string) $this->getManager()->getValue('sLinkMobilityMessageFromContentname');
|
||||||
|
|
||||||
if ($blExpected === true) {
|
if ($blExpected === true) {
|
||||||
return (bool) strlen( trim( $contentname ) ) === true &&
|
return (bool) strlen(trim($contentname)) === true &&
|
||||||
$content->exists(trim( $contentname )) === true;
|
$content->exists(trim($contentname)) === true;
|
||||||
} else {
|
} else {
|
||||||
return (bool) strlen( trim( $contentname ) ) === false ||
|
return (bool) strlen(trim($contentname)) === false ||
|
||||||
$content->exists(trim( $contentname )) === false;
|
$content->exists(trim($contentname)) === false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -208,14 +209,14 @@ class d3linkmobility_ordermanager_action extends d3ordermanager_action_abstract
|
|||||||
*/
|
*/
|
||||||
protected function hasRequiredValuesRecipient(): bool
|
protected function hasRequiredValuesRecipient(): bool
|
||||||
{
|
{
|
||||||
$toCust = (bool) $this->getManager()->getValue( 'blLinkMobilityMessageToCustomer' );
|
$toCust = (bool) $this->getManager()->getValue('blLinkMobilityMessageToCustomer');
|
||||||
$toCustom = (bool) $this->getManager()->getValue( 'blLinkMobilityMessageToCustom' );
|
$toCustom = (bool) $this->getManager()->getValue('blLinkMobilityMessageToCustom');
|
||||||
$toCustomAddress = (string) $this->getManager()->getValue( 'sLinkMobilityMessageToCustomAddress' );
|
$toCustomAddress = (string) $this->getManager()->getValue('sLinkMobilityMessageToCustomAddress');
|
||||||
|
|
||||||
return $toCust || (
|
return $toCust || (
|
||||||
$toCustom &&
|
$toCustom &&
|
||||||
(bool) strlen( trim( $toCustomAddress ) )
|
(bool) strlen(trim($toCustomAddress))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -272,8 +273,8 @@ class d3linkmobility_ordermanager_action extends d3ordermanager_action_abstract
|
|||||||
/**
|
/**
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function getActiveSwitchParameter() : string
|
public function getActiveSwitchParameter(): string
|
||||||
{
|
{
|
||||||
return self::ACTIVE_SWITCH;
|
return self::ACTIVE_SWITCH;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -24,4 +24,4 @@ class emptyMesageException extends StandardException
|
|||||||
$sMessage = 'empty message content in task '.$sMessage;
|
$sMessage = 'empty message content in task '.$sMessage;
|
||||||
parent::__construct($sMessage, $iCode, $previous);
|
parent::__construct($sMessage, $iCode, $previous);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -123,7 +123,7 @@ class d3linkmobility_ordermanager_sender
|
|||||||
// ToDo: check in TWIG and change to a generic solution (e.g. path names in template name)
|
// ToDo: check in TWIG and change to a generic solution (e.g. path names in template name)
|
||||||
// Smarty only
|
// Smarty only
|
||||||
if (method_exists($templateEngine, '__set')) {
|
if (method_exists($templateEngine, '__set')) {
|
||||||
$templateEngine->__set( 'template_dir', $this->getTemplateDir4OrderManager( $oManager ) );
|
$templateEngine->__set('template_dir', $this->getTemplateDir4OrderManager($oManager));
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($viewData as $id => $value) {
|
foreach ($viewData as $id => $value) {
|
||||||
@ -190,7 +190,7 @@ class d3linkmobility_ordermanager_sender
|
|||||||
* @param Manager $oManager
|
* @param Manager $oManager
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function getTemplateDir4OrderManager( Manager $oManager ): string
|
public function getTemplateDir4OrderManager(Manager $oManager): string
|
||||||
{
|
{
|
||||||
if ($oManager->getValue('sLinkMobilityMessageFromTheme') == 'module') {
|
if ($oManager->getValue('sLinkMobilityMessageFromTheme') == 'module') {
|
||||||
$sModuleId = $oManager->getValue('sLinkMobilityMessageFromModulePath');
|
$sModuleId = $oManager->getValue('sLinkMobilityMessageFromModulePath');
|
||||||
@ -261,7 +261,7 @@ class d3linkmobility_ordermanager_sender
|
|||||||
|
|
||||||
if (strlen($customAddresses)) {
|
if (strlen($customAddresses)) {
|
||||||
foreach (explode(';', $customAddresses) as $addressGroups) {
|
foreach (explode(';', $customAddresses) as $addressGroups) {
|
||||||
list($phoneNumber, $countryId) = explode('@', trim($addressGroups));
|
[$phoneNumber, $countryId] = explode('@', trim($addressGroups));
|
||||||
$addresses[trim($phoneNumber)] = trim($countryId);
|
$addresses[trim($phoneNumber)] = trim($countryId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -300,4 +300,4 @@ class d3linkmobility_ordermanager_sender
|
|||||||
{
|
{
|
||||||
return $this->manager;
|
return $this->manager;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,7 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
$sLangName = 'Deutsch';
|
$sLangName = 'Deutsch';
|
||||||
|
|
||||||
$aLang = array(
|
$aLang = [
|
||||||
'charset' => 'UTF-8',
|
'charset' => 'UTF-8',
|
||||||
|
|
||||||
'D3_LINKMOBILITY_ORDERMANAGER_ACTION' => 'SMS senden (via LINK Mobility)',
|
'D3_LINKMOBILITY_ORDERMANAGER_ACTION' => 'SMS senden (via LINK Mobility)',
|
||||||
@ -53,6 +53,6 @@ $aLang = array(
|
|||||||
'D3_ORDERMANAGER_JOBDESC_SENDLMMESSAGE_EMPTYMESSAGE' => 'SMS wurde wegen leerer Nachricht nicht gesendet',
|
'D3_ORDERMANAGER_JOBDESC_SENDLMMESSAGE_EMPTYMESSAGE' => 'SMS wurde wegen leerer Nachricht nicht gesendet',
|
||||||
'D3_ORDERMANAGER_JOBDESC_SENDLMMESSAGE_NORECIPIENT' => 'SMS wurde wegen fehlender Empfänger nicht gesendet',
|
'D3_ORDERMANAGER_JOBDESC_SENDLMMESSAGE_NORECIPIENT' => 'SMS wurde wegen fehlender Empfänger nicht gesendet',
|
||||||
'D3_ORDERMANAGER_JOBDESC_SENDLMMESSAGE_RECIPIENTERROR' => 'SMS Empfänger %1$s (%2$s) konnte nicht verwendet werden',
|
'D3_ORDERMANAGER_JOBDESC_SENDLMMESSAGE_RECIPIENTERROR' => 'SMS Empfänger %1$s (%2$s) konnte nicht verwendet werden',
|
||||||
);
|
];
|
||||||
|
|
||||||
// @codeCoverageIgnoreEnd
|
// @codeCoverageIgnoreEnd
|
||||||
|
@ -17,5 +17,7 @@ namespace D3\Linkmobility4Ordermanager\Modules\Ordermanager\Application\Model
|
|||||||
{
|
{
|
||||||
use D3\Ordermanager\Application\Model\d3ordermanager_conf;
|
use D3\Ordermanager\Application\Model\d3ordermanager_conf;
|
||||||
|
|
||||||
class d3ordermanager_conf_linkmobility_parent extends d3ordermanager_conf {}
|
class d3ordermanager_conf_linkmobility_parent extends d3ordermanager_conf
|
||||||
}
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -53,4 +53,4 @@ class d3ordermanager_conf_linkmobility extends d3ordermanager_conf_linkmobility_
|
|||||||
|
|
||||||
return $moduleStateService->isActive('d3linkmobility', Registry::getConfig()->getShopId());
|
return $moduleStateService->isActive('d3linkmobility', Registry::getConfig()->getShopId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -36,13 +36,13 @@ $aModule = [
|
|||||||
'email' => 'support@shopmodule.com',
|
'email' => 'support@shopmodule.com',
|
||||||
'url' => 'https://www.oxidmodule.com/',
|
'url' => 'https://www.oxidmodule.com/',
|
||||||
'extend' => [
|
'extend' => [
|
||||||
d3ordermanager_conf::class => d3ordermanager_conf_linkmobility::class
|
d3ordermanager_conf::class => d3ordermanager_conf_linkmobility::class,
|
||||||
],
|
],
|
||||||
'controllers' => [],
|
'controllers' => [],
|
||||||
'templates' => [
|
'templates' => [
|
||||||
'd3linkmobility_ordermanager_action.tpl' => 'd3/linkmobility4ordermanager/Application/views/admin/tpl/d3linkmobility_ordermanager_action.tpl'
|
'd3linkmobility_ordermanager_action.tpl' => 'd3/linkmobility4ordermanager/Application/views/admin/tpl/d3linkmobility_ordermanager_action.tpl',
|
||||||
],
|
],
|
||||||
'events' => [],
|
'events' => [],
|
||||||
'blocks' => [],
|
'blocks' => [],
|
||||||
'settings' => []
|
'settings' => [],
|
||||||
];
|
];
|
||||||
|
Loading…
Reference in New Issue
Block a user