File tree Expand file tree Collapse file tree 9 files changed +20
-58
lines changed Expand file tree Collapse file tree 9 files changed +20
-58
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 1616
1717final 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 ,
Original file line number Diff line number Diff line change 1414
1515final 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 ,
Original file line number Diff line number Diff line change 1414
1515final 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 ,
Original file line number Diff line number Diff 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 {
Original file line number Diff line number Diff 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 {
Original file line number Diff line number Diff line change 1111 " groups"
1212 ],
1313 "require" : {
14- "php" : " ^7.1 " ,
14+ "php" : " ^7.4 " ,
1515 "magento/framework" : " *" ,
1616 "magento/module-catalog" : " *" ,
1717 "magento/module-checkout" : " *" ,
Original file line number Diff line number Diff line change 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 >
You can’t perform that action at this time.
0 commit comments