Skip to content

Commit d83d6d5

Browse files
authored
Merge pull request #67 from trinos-nl/master
PHP 8.1 compatibility
2 parents d32f259 + f48d29e commit d83d6d5

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed
Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
<?php
2-
namespace Experius\Postcode\Block\System\Config\Form\Field;
3-
4-
use Magento\Framework\Data\Form\Element\AbstractElement;
5-
6-
class ReadOnly extends \Magento\Config\Block\System\Config\Form\Field
7-
{
8-
protected function _getElementHtml(AbstractElement $element)
9-
{
10-
$element->setData('readonly', 1);
11-
return $element->getElementHtml();
12-
}
13-
}
1+
<?php
2+
namespace Experius\Postcode\Block\System\Config\Form\Field;
3+
4+
use Magento\Framework\Data\Form\Element\AbstractElement;
5+
6+
class ReadOnlyField extends \Magento\Config\Block\System\Config\Form\Field
7+
{
8+
protected function _getElementHtml(AbstractElement $element)
9+
{
10+
$element->setData('readonly', 1);
11+
return $element->getElementHtml();
12+
}
13+
}

Helper/Data.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -368,17 +368,17 @@ protected function getStoreConfig($path)
368368

369369
protected function getKey()
370370
{
371-
return trim($this->getStoreConfig('postcodenl_api/general/api_key'));
371+
return trim($this->getStoreConfig('postcodenl_api/general/api_key') ?? '');
372372
}
373373

374374
protected function getSecret()
375375
{
376-
return trim($this->getStoreConfig('postcodenl_api/general/api_secret'));
376+
return trim($this->getStoreConfig('postcodenl_api/general/api_secret') ?? '');
377377
}
378378

379379
protected function getServiceUrl()
380380
{
381-
$serviceUrl = trim($this->getStoreConfig('postcodenl_api/development_config/api_url'));
381+
$serviceUrl = trim($this->getStoreConfig('postcodenl_api/development_config/api_url') ?? '');
382382
if (empty($serviceUrl)) {
383383
$serviceUrl = self::API_URL;
384384
}

etc/adminhtml/system.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
</field>
2323
<field id="api_key_is_valid" showInDefault="1" showInStore="1" showInWebsite="1" sortOrder="40" translate="label" type="text">
2424
<label>Api Key is valid</label>
25-
<frontend_model>Experius\Postcode\Block\System\Config\Form\Field\ReadOnly</frontend_model>
25+
<frontend_model>Experius\Postcode\Block\System\Config\Form\Field\ReadOnlyField</frontend_model>
2626
</field>
2727
<field id="api_key_checker" showInDefault="1" showInStore="1" showInWebsite="1" sortOrder="41" translate="label" type="button">
2828
<button_label>Check Api Key</button_label>

0 commit comments

Comments
 (0)