Skip to content

Commit 5899d3a

Browse files
committed
php74 support version
1 parent 4d74267 commit 5899d3a

File tree

9 files changed

+20
-58
lines changed

9 files changed

+20
-58
lines changed

Model/CanShowPrice.php

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,25 +20,18 @@ final class CanShowPrice implements CanShowPriceInterface
2020
private const CONFIG_PATH_RESTRICT_SHOW_PRICE = 'catalog/price/restrict_show_price';
2121
private const CONFIG_PATH_CAN_SHOW_PRICE_GROUPS = 'catalog/price/can_show_price_groups';
2222

23-
/**
24-
* @var ScopeConfigInterface
25-
*/
26-
private $scopeConfig;
23+
private ScopeConfigInterface $scopeConfig;
2724

28-
/**
29-
* @var array|null
30-
*/
31-
private $allowedGroups;
25+
private ?array $allowedGroups;
3226

33-
/**
34-
* @var bool|null
35-
*/
36-
private $isEnabled;
27+
private ?bool $isEnabled;
3728

3829
public function __construct(
3930
ScopeConfigInterface $scopeConfig
4031
) {
4132
$this->scopeConfig = $scopeConfig;
33+
$this->allowedGroups = null;
34+
$this->isEnabled = null;
4235
}
4336

4437
public function canShowPrice(int $customerGroupId): bool

Model/IsSaleable.php

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,25 +20,18 @@ final class IsSaleable implements IsSaleableInterface
2020
private const CONFIG_PATH_RESTRICT_SALEABLE = 'checkout/cart/restrict_saleable';
2121
private const CONFIG_PATH_IS_SALEABLE_GROUPS = 'checkout/cart/is_saleable_groups';
2222

23-
/**
24-
* @var ScopeConfigInterface
25-
*/
26-
private $scopeConfig;
23+
private ScopeConfigInterface $scopeConfig;
2724

28-
/**
29-
* @var array|null
30-
*/
31-
private $allowedGroups;
25+
private ?array $allowedGroups;
3226

33-
/**
34-
* @var bool|null
35-
*/
36-
private $isEnabled;
27+
private ?bool $isEnabled;
3728

3829
public function __construct(
3930
ScopeConfigInterface $scopeConfig
4031
) {
4132
$this->scopeConfig = $scopeConfig;
33+
$this->allowedGroups = null;
34+
$this->isEnabled = null;
4235
}
4336

4437
public function isSaleable(int $customerGroupId): bool

Observer/Product/IsSaleable.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,9 @@
1616

1717
final class IsSaleable implements ObserverInterface
1818
{
19-
/**
20-
* @var HttpContext
21-
*/
22-
private $httpContext;
19+
private HttpContext $httpContext;
2320

24-
/**
25-
* @var IsSaleableInterface
26-
*/
27-
private $isSaleable;
21+
private IsSaleableInterface $isSaleable;
2822

2923
public function __construct(
3024
HttpContext $httpContext,

Plugin/Pricing/CanShowPrice.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,9 @@
1414

1515
final class CanShowPrice
1616
{
17-
/**
18-
* @var HttpContext
19-
*/
20-
private $httpContext;
17+
private HttpContext $httpContext;
2118

22-
/**
23-
* @var CanShowPriceInterface
24-
*/
25-
private $canShowPrice;
19+
private CanShowPriceInterface $canShowPrice;
2620

2721
public function __construct(
2822
HttpContext $httpContext,

Plugin/Saleable/CanShowPrice.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,9 @@
1414

1515
final class CanShowPrice
1616
{
17-
/**
18-
* @var HttpContext
19-
*/
20-
private $httpContext;
17+
private HttpContext $httpContext;
2118

22-
/**
23-
* @var CanShowPriceInterface
24-
*/
25-
private $canShowPrice;
19+
private CanShowPriceInterface $canShowPrice;
2620

2721
public function __construct(
2822
HttpContext $httpContext,

Test/Unit/Model/TestCanShowPrice.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@ final class TestCanShowPrice extends TestCase
1919
*/
2020
private $scopeConfig;
2121

22-
/**
23-
* @var CanShowPrice
24-
*/
25-
private $canShowPrice;
22+
private CanShowPrice $canShowPrice;
2623

2724
protected function setUp(): void
2825
{

Test/Unit/Model/TestIsSaleable.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@ final class TestIsSaleable extends TestCase
1919
*/
2020
private $scopeConfig;
2121

22-
/**
23-
* @var IsSaleable
24-
*/
25-
private $isSaleable;
22+
private IsSaleable $isSaleable;
2623

2724
protected function setUp(): void
2825
{

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"groups"
1212
],
1313
"require": {
14-
"php": "^7.1",
14+
"php": "^7.4",
1515
"magento/framework": "*",
1616
"magento/module-catalog": "*",
1717
"magento/module-checkout": "*",

etc/adminhtml/system.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
99
<system>
1010
<section id="catalog">
11-
<group id="price">
11+
<group id="price" showInWebsite="1">
1212
<field id="restrict_show_price" translate="label" type="select" showInDefault="1" showInWebsite="1" showInStore="0" sortOrder="10" canRestore="1">
1313
<label>Restrict Show Prices Mode</label>
1414
<source_model>Magento\Config\Model\Config\Source\Enabledisable</source_model>

0 commit comments

Comments
 (0)