Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
tig-mickeybeijer committed Mar 21, 2023
2 parents 94291a9 + 691ccb1 commit aeb2a15
Show file tree
Hide file tree
Showing 107 changed files with 1,347 additions and 488 deletions.
15 changes: 8 additions & 7 deletions Block/Adminhtml/Config/Credentials/Button.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,17 @@

class Button extends Template implements RendererInterface
{
const MODULE_NAME = 'TIG_Postcode';
public const MODULE_NAME = 'TIG_Postcode';

const CREDENTIALS_URL = 'https://postcodeservice.nl';
public const CREDENTIALS_URL = 'https://postcodeservice.nl';

// @codingStandardsIgnoreLine
protected $_template = 'TIG_Postcode::config/credentials/button.phtml';

// @codeCoverageIgnoreStart
/**
* @param AbstractElement $element
*
* @return string
* @inheritdoc
*/
// @codeCoverageIgnoreStart
public function render(AbstractElement $element)
{
/** @noinspection PhpUndefinedMethodInspection */
Expand All @@ -60,15 +58,18 @@ public function render(AbstractElement $element)
// @codeCoverageIgnoreEnd

/**
* Get Label
*
* @return \Magento\Framework\Phrase
*/
public function getLabel()
{
// @codingStandardsIgnoreLine
return __('Request Credentails');
}

/**
* Get credentials Url
*
* @return string
*/
public function getCredentialsUrl()
Expand Down
5 changes: 2 additions & 3 deletions Block/Adminhtml/Config/Form/Field/Disable.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,15 @@
class Disable extends Field
{
/**
* @inheritdoc
*
* @param AbstractElement $element
*
* @return string
*/
// @codeCoverageIgnoreStart
// @codingStandardsIgnoreLine
protected function _getElementHtml(AbstractElement $element)
{
$element->setDisabled('disabled');
return parent::_getElementHtml($element);
}
// @codeCoverageIgnoreEnd
}
6 changes: 4 additions & 2 deletions Block/Adminhtml/Config/Form/Field/Fieldset.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,18 @@

class Fieldset extends MagentoFieldset
{
/**
* @var string[]
*/
private $classNames = [
'1' => 'modus_live',
'2' => 'modus_test',
'0' => 'modus_off'
];

/**
* {@inheritdoc}
* @inheritdoc
*/
// @codingStandardsIgnoreLine
protected function _getFrontendClass($element)
{
$modus = $this->_scopeConfig->getValue(ModuleConfiguration::XPATH_CONFIGURATION_MODUS);
Expand Down
12 changes: 5 additions & 7 deletions Block/Adminhtml/Config/Parsing/Streets.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,23 +37,21 @@

class Streets extends Template implements RendererInterface
{
const MODULE_NAME = 'TIG_Postcode';
public const MODULE_NAME = 'TIG_Postcode';

// @codingStandardsIgnoreLine
/**
* @var string
*/
protected $_template = 'TIG_Postcode::config/parsing/streets.phtml';

/**
* @param AbstractElement $element
*
* @return string
* @inheritdoc
*/
// @codeCoverageIgnoreStart
public function render(AbstractElement $element)
{
/** @noinspection PhpUndefinedMethodInspection */
$this->setElement($element);

return $this->toHtml();
}
// @codeCoverageIgnoreEnd
}
5 changes: 2 additions & 3 deletions Block/Adminhtml/Config/Support/BodyClass.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@
class BodyClass extends Template implements BlockInterface
{
/**
* @inheritdoc
*
* @return $this
*/
// @codeCoverageIgnoreStart
// @codingStandardsIgnoreLine
protected function _prepareLayout()
{
if ($this->_request->getParam('section') == 'tig_postcode') {
Expand All @@ -50,5 +50,4 @@ protected function _prepareLayout()

return parent::_prepareLayout();
}
// @codeCoverageIgnoreEnd
}
6 changes: 4 additions & 2 deletions Block/Adminhtml/Config/Support/Tab.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class Tab extends Template implements RendererInterface
{
const MODULE_NAME = 'TIG_Postcode';

const EXTENSION_VERSION = '1.5.2';
const EXTENSION_VERSION = '1.5.3';

// @codingStandardsIgnoreLine
protected $_template = 'TIG_Postcode::config/support/tab.phtml';
Expand Down Expand Up @@ -68,7 +68,7 @@ public function __construct(
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function render(AbstractElement $element)
{
Expand All @@ -89,6 +89,8 @@ public function getVersionNumber()
}

/**
* Get supported magento version
*
* @return string
*/
public function getSupportedMagentoVersions()
Expand Down
2 changes: 2 additions & 0 deletions Config/CheckoutConfiguration/ActionUrl.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ public function __construct(
}

/**
* Get value and return belgium postcode URLs
*
* @return array
*/
public function getValue()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
interface CheckoutConfigurationInterface
{
/**
* Get value
*
* @return bool|string
*/
public function getValue();
Expand Down
5 changes: 5 additions & 0 deletions Config/CheckoutConfiguration/StreetParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@

class StreetParser implements CheckoutConfigurationInterface
{
/**
* @var ModuleConfiguration
*/
private $moduleConfiguration;

/**
Expand All @@ -55,6 +58,8 @@ public function __construct(
}

/**
* Get value and return the housenumber information
*
* @return mixed
*/
public function getValue()
Expand Down
14 changes: 11 additions & 3 deletions Config/Provider/AbstractConfigProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ public function __construct(
/**
* Get Config value with xpath
*
* @param $xpath
* @param null $store
* @param string|int $xpath
* @param null $store
*
* @return mixed
*/
Expand All @@ -100,7 +100,12 @@ protected function getConfigFromXpath($xpath, $store = null)
}

/**
* Check if the output is enabled
*
* @return bool
*
* @deprecated unused method
* @since v1.5.0
*/
// @codingStandardsIgnoreLine
protected function isModuleOutputEnabled()
Expand All @@ -109,9 +114,12 @@ protected function isModuleOutputEnabled()
}

/**
* @param $type
* Get the base Url
*
* @param string|UrlInterface $type
*
* @return mixed
* @throws \Magento\Framework\Exception\NoSuchEntityException
*/
// @codingStandardsIgnoreLine
protected function getBaseUrl($type = UrlInterface::URL_TYPE_WEB)
Expand Down
32 changes: 20 additions & 12 deletions Config/Provider/ApiConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,17 @@

class ApiConfiguration extends AbstractConfigProvider
{
const XPATH_API_BASE = 'tig_postcode/api/base';
const XPATH_API_VERSION = 'tig_postcode/api/version';
const XPATH_API_TYPE = 'tig_postcode/api/type';
public const XPATH_API_BASE = 'tig_postcode/api/base';
public const XPATH_API_VERSION = 'tig_postcode/api/version';
public const XPATH_API_TYPE = 'tig_postcode/api/type';

const XPATH_API_BE_BASE = 'tig_postcode/api_be/base';
const XPATH_API_BE_POSTCODE_VERSION = 'tig_postcode/api_be/postcode_version';
const XPATH_API_BE_STREET_VERSION = 'tig_postcode/api_be/street_version';
public const XPATH_API_BE_BASE = 'tig_postcode/api_be/base';
public const XPATH_API_BE_POSTCODE_VERSION = 'tig_postcode/api_be/postcode_version';
public const XPATH_API_BE_STREET_VERSION = 'tig_postcode/api_be/street_version';

/**
* Get base Uri
*
* @return string
*/
public function getBaseUri()
Expand All @@ -50,6 +52,8 @@ public function getBaseUri()
}

/**
* Get Belgium base Uri
*
* @param string $endpoint
*
* @return string
Expand All @@ -60,8 +64,10 @@ public function getBeBaseUri($endpoint)
}

/**
* @param null $store
* @param string $country
* Get base path via country and store ID
*
* @param string $country
* @param string|int|null $store
*
* @return mixed
*/
Expand All @@ -78,9 +84,9 @@ public function getBase($country = 'NL', $store = null)
/**
* Versioning for BE is not live yet. Implement this function in getBeBaseUri when this goes live.
*
* @param null $store
* @param string|null $country
* @param string|null $endpoint
* @param string $country
* @param string|null $endpoint
* @param string|int|null $store
*
* @return mixed
*/
Expand All @@ -99,7 +105,9 @@ public function getVersion($country = 'NL', $endpoint = null, $store = null)
}

/**
* @param null $store
* Get type via store ID
*
* @param string|int|null $store
*
* @return mixed
*/
Expand Down
36 changes: 27 additions & 9 deletions Config/Provider/CheckoutConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,28 +41,38 @@

class CheckoutConfiguration extends AbstractConfigProvider implements ConfigProviderInterface
{
const XPATH_POSTCODE_SORT_ORDER = 'tig_postcode/checkout/postcode_sort_order';
const XPATH_CITY_SORT_ORDER = 'tig_postcode/checkout/city_sort_order';
const XPATH_COUNTRY_SORT_ORDER = 'tig_postcode/checkout/country_sort_order';
private const XPATH_POSTCODE_SORT_ORDER = 'tig_postcode/checkout/postcode_sort_order';
private const XPATH_CITY_SORT_ORDER = 'tig_postcode/checkout/city_sort_order';
private const XPATH_COUNTRY_SORT_ORDER = 'tig_postcode/checkout/country_sort_order';

/**
* @var array
*/
private $postcodeConfiguration;

/**
* @param ScopeConfigInterface $scopeConfig
* @param Manager $moduleManager
* @param Encryptor $crypt
* @param StoreManagerInterface $storeManager
* @param array $postcodeConfiguration
*/
public function __construct(
ScopeConfigInterface $scopeConfig,
Manager $moduleManager,
Encryptor $crypt,
StoreManagerInterface $storeManager,
$postcodeConfiguration = []
) {
$this->postcodeConfiguration = $postcodeConfiguration;
$this->postcodeConfiguration = $postcodeConfiguration;
parent::__construct($scopeConfig, $moduleManager, $crypt, $storeManager);
}

/**
* Get config for postcode
*
* @return array
* @throws Exception
*/
public function getConfig()
{
Expand All @@ -78,8 +88,10 @@ public function getConfig()
}

/**
* @param $configuration
* @param $key
* Check Implementationn of the configuration
*
* @param CheckoutConfigurationInterface $configuration
* @param string|int $key
*
* @throws Exception
*/
Expand All @@ -92,7 +104,9 @@ private function checkImplementation($configuration, $key)
}

/**
* @param null $store
* Get Postcode sortOrder by store ID
*
* @param string|int|null $store
*
* @return string
*/
Expand All @@ -102,7 +116,9 @@ public function getPostcodeSortOrder($store = null)
}

/**
* @param null $store
* Get City sortOrder by store ID
*
* @param string|int|null $store
*
* @return string
*/
Expand All @@ -112,7 +128,9 @@ public function getCitySortOrder($store = null)
}

/**
* @param null $store
* Get Country sortOrder by store ID
*
* @param string|int|null $store
*
* @return string
*/
Expand Down
Loading

0 comments on commit aeb2a15

Please sign in to comment.