Skip to content

Commit a1fa9f7

Browse files
committed
ACPT-1052: Some Luma Storefront Scenarios Are Broken
- fix static tests
1 parent cd23b13 commit a1fa9f7

File tree

23 files changed

+100
-85
lines changed

23 files changed

+100
-85
lines changed

app/code/Magento/Catalog/Model/Layer.php

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,29 +42,21 @@ class Layer extends \Magento\Framework\DataObject implements ResetAfterRequestIn
4242
protected $registry = null;
4343

4444
/**
45-
* Store manager
46-
*
4745
* @var \Magento\Store\Model\StoreManagerInterface
4846
*/
4947
protected $_storeManager;
5048

5149
/**
52-
* Catalog product
53-
*
5450
* @var \Magento\Catalog\Model\ResourceModel\Product
5551
*/
5652
protected $_catalogProduct;
5753

5854
/**
59-
* Attribute collection factory
60-
*
6155
* @var AttributeCollectionFactory
6256
*/
6357
protected $_attributeCollectionFactory;
6458

6559
/**
66-
* Layer state factory
67-
*
6860
* @var \Magento\Catalog\Model\Layer\StateFactory
6961
*/
7062
protected $_layerStateFactory;
@@ -188,6 +180,7 @@ public function apply()
188180

189181
/**
190182
* Retrieve current category model
183+
*
191184
* If no category found in registry, the root will be taken
192185
*
193186
* @return \Magento\Catalog\Model\Category

app/code/Magento/CatalogRule/Model/Rule.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,22 +36,23 @@
3636
use Magento\Framework\Serialize\Serializer\Json;
3737
use Magento\Framework\Stdlib\DateTime;
3838
use Magento\Framework\Stdlib\DateTime\TimezoneInterface;
39+
use Magento\Rule\Model\AbstractModel;
3940
use Magento\Store\Model\StoreManagerInterface;
4041

4142
/**
4243
* Catalog Rule data model
4344
*
44-
* @method \Magento\CatalogRule\Model\Rule setFromDate(string $value)
45-
* @method \Magento\CatalogRule\Model\Rule setToDate(string $value)
46-
* @method \Magento\CatalogRule\Model\Rule setCustomerGroupIds(string $value)
45+
* @method Rule setFromDate(string $value)
46+
* @method Rule setToDate(string $value)
47+
* @method Rule setCustomerGroupIds(string $value)
4748
* @method string getWebsiteIds()
48-
* @method \Magento\CatalogRule\Model\Rule setWebsiteIds(string $value)
49+
* @method Rule setWebsiteIds(string $value)
4950
* @SuppressWarnings(PHPMD.TooManyFields)
5051
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
5152
* @SuppressWarnings(PHPMD.ExcessivePublicCount)
5253
* @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
5354
*/
54-
class Rule extends \Magento\Rule\Model\AbstractModel implements RuleInterface, IdentityInterface, ResetAfterRequestInterface
55+
class Rule extends AbstractModel implements RuleInterface, IdentityInterface, ResetAfterRequestInterface
5556
{
5657
/**
5758
* Prefix of model events names

app/code/Magento/Directory/Model/Country.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ public function __construct(
6565
}
6666

6767
/**
68+
* Country model constructor
69+
*
6870
* @return void
6971
*/
7072
protected function _construct()
@@ -95,6 +97,8 @@ public function getRegions()
9597
}
9698

9799
/**
100+
* Get region collection with loaded data
101+
*
98102
* @return \Magento\Directory\Model\ResourceModel\Region\Collection
99103
*/
100104
public function getLoadedRegionCollection()
@@ -105,6 +109,8 @@ public function getLoadedRegionCollection()
105109
}
106110

107111
/**
112+
* Get region collection
113+
*
108114
* @return \Magento\Directory\Model\ResourceModel\Region\Collection
109115
*/
110116
public function getRegionCollection()
@@ -115,6 +121,8 @@ public function getRegionCollection()
115121
}
116122

117123
/**
124+
* Format address
125+
*
118126
* @param \Magento\Framework\DataObject $address
119127
* @param bool $html
120128
* @return string
@@ -204,9 +212,10 @@ public function getFormat($type)
204212
/**
205213
* Get country name
206214
*
215+
* @param ?string $locale
207216
* @return string
208217
*/
209-
public function getName($locale = null)
218+
public function getName(string $locale = null)
210219
{
211220
if ($locale == null) {
212221
$cache_key = 'name_default';

app/code/Magento/Directory/Model/ResourceModel/Currency.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
class Currency extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb implements ResetAfterRequestInterface
1818
{
1919
/**
20-
* Currency rate table
20+
* Currency rate table name
2121
*
2222
* @var string
2323
*/

app/code/Magento/Eav/Model/Entity/AbstractEntity.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@
3535
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
3636
* @since 100.0.2
3737
*/
38-
abstract class AbstractEntity extends AbstractResource implements EntityInterface, DefaultAttributesProvider,
38+
abstract class AbstractEntity extends AbstractResource implements
39+
EntityInterface,
40+
DefaultAttributesProvider,
3941
ResetAfterRequestInterface
4042
{
4143
/**

app/code/Magento/GraphQl/Model/Query/Resolver/Context.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@
1313
/**
1414
* Do not use this class. It was kept for backward compatibility.
1515
*
16-
* @deprecated 100.3.3 \Magento\GraphQl\Model\Query\Context is used instead of this
16+
* @deprecated 100.3.3 @see \Magento\GraphQl\Model\Query\Context
1717
*/
1818
class Context extends \Magento\Framework\Model\AbstractExtensibleModel implements ContextInterface
1919
{
2020
/**#@+
2121
* Constants defined for type of context
2222
*/
23-
const USER_TYPE_ID = 'user_type';
24-
const USER_ID = 'user_id';
23+
public const USER_TYPE_ID = 'user_type';
24+
public const USER_ID = 'user_id';
2525
/**#@-*/
2626

2727
/**
@@ -95,6 +95,4 @@ public function _resetState(): void
9595
{
9696
$this->_data = [];
9797
}
98-
99-
10098
}

app/code/Magento/Tax/Model/Calculation.php

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,37 +30,37 @@ class Calculation extends \Magento\Framework\Model\AbstractModel implements Rese
3030
/**
3131
* Identifier constant for Tax calculation before discount excluding TAX
3232
*/
33-
const CALC_TAX_BEFORE_DISCOUNT_ON_EXCL = '0_0';
33+
public const CALC_TAX_BEFORE_DISCOUNT_ON_EXCL = '0_0';
3434

3535
/**
3636
* Identifier constant for Tax calculation before discount including TAX
3737
*/
38-
const CALC_TAX_BEFORE_DISCOUNT_ON_INCL = '0_1';
38+
public const CALC_TAX_BEFORE_DISCOUNT_ON_INCL = '0_1';
3939

4040
/**
4141
* Identifier constant for Tax calculation after discount excluding TAX
4242
*/
43-
const CALC_TAX_AFTER_DISCOUNT_ON_EXCL = '1_0';
43+
public const CALC_TAX_AFTER_DISCOUNT_ON_EXCL = '1_0';
4444

4545
/**
4646
* Identifier constant for Tax calculation after discount including TAX
4747
*/
48-
const CALC_TAX_AFTER_DISCOUNT_ON_INCL = '1_1';
48+
public const CALC_TAX_AFTER_DISCOUNT_ON_INCL = '1_1';
4949

5050
/**
5151
* Identifier constant for unit based calculation
5252
*/
53-
const CALC_UNIT_BASE = 'UNIT_BASE_CALCULATION';
53+
public const CALC_UNIT_BASE = 'UNIT_BASE_CALCULATION';
5454

5555
/**
5656
* Identifier constant for row based calculation
5757
*/
58-
const CALC_ROW_BASE = 'ROW_BASE_CALCULATION';
58+
public const CALC_ROW_BASE = 'ROW_BASE_CALCULATION';
5959

6060
/**
6161
* Identifier constant for total based calculation
6262
*/
63-
const CALC_TOTAL_BASE = 'TOTAL_BASE_CALCULATION';
63+
public const CALC_TOTAL_BASE = 'TOTAL_BASE_CALCULATION';
6464

6565
/**
6666
* Identifier constant for unit based calculation
@@ -169,22 +169,16 @@ class Calculation extends \Magento\Framework\Model\AbstractModel implements Rese
169169
protected $priceCurrency;
170170

171171
/**
172-
* Filter Builder
173-
*
174172
* @var FilterBuilder
175173
*/
176174
protected $filterBuilder;
177175

178176
/**
179-
* Search Criteria Builder
180-
*
181177
* @var SearchCriteriaBuilder
182178
*/
183179
protected $searchCriteriaBuilder;
184180

185181
/**
186-
* Tax Class Repository
187-
*
188182
* @var TaxClassRepositoryInterface
189183
*/
190184
protected $taxClassRepository;
@@ -250,6 +244,8 @@ public function __construct(
250244
}
251245

252246
/**
247+
* Tax Calculation Model Contructor
248+
*
253249
* @return void
254250
*/
255251
protected function _construct()
@@ -495,7 +491,7 @@ protected function _isCrossBorderTradeEnabled($store = null)
495491
* @param null|int $customerTaxClass
496492
* @param null|int|\Magento\Store\Model\Store $store
497493
* @param int $customerId
498-
* @return \Magento\Framework\DataObject
494+
* @return \Magento\Framework\DataObject
499495
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
500496
* @SuppressWarnings(PHPMD.NPathComplexity)
501497
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
@@ -651,6 +647,7 @@ public function reproduceProcess($rates)
651647

652648
/**
653649
* Calculate rated tax amount based on price and tax rate.
650+
*
654651
* If you are using price including tax $priceIncludeTax should be true.
655652
*
656653
* @param float $price
@@ -688,6 +685,8 @@ public function round($price)
688685
}
689686

690687
/**
688+
* Get Tax Rates
689+
*
691690
* @param array $billingAddress
692691
* @param array $shippingAddress
693692
* @param int $customerTaxClassId

app/code/Magento/Tax/Model/ClassModelRegistry.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
class ClassModelRegistry implements ResetAfterRequestInterface
1818
{
1919
/**
20-
* Tax class model factory
21-
*
2220
* @var TaxClassModelFactory
2321
*/
2422
private $taxClassModelFactory;

app/code/Magento/Tax/Model/TaxCalculation.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,15 +81,11 @@ class TaxCalculation implements TaxCalculationInterface, ResetAfterRequestInterf
8181
private $parentToChildren;
8282

8383
/**
84-
* Tax Class Management
85-
*
8684
* @var TaxClassManagementInterface
8785
*/
8886
protected $taxClassManagement;
8987

9088
/**
91-
* Calculator Factory
92-
*
9389
* @var CalculatorFactory
9490
*/
9591
protected $calculatorFactory;
@@ -130,7 +126,7 @@ public function __construct(
130126
}
131127

132128
/**
133-
* {@inheritdoc}
129+
* @inheritdoc
134130
*/
135131
public function calculateTax(
136132
\Magento\Tax\Api\Data\QuoteDetailsInterface $quoteDetails,
@@ -201,7 +197,7 @@ public function calculateTax(
201197
}
202198

203199
/**
204-
* {@inheritdoc}
200+
* @inheritdoc
205201
*/
206202
public function getDefaultCalculatedRate(
207203
$productTaxClassID,
@@ -212,7 +208,7 @@ public function getDefaultCalculatedRate(
212208
}
213209

214210
/**
215-
* {@inheritdoc}
211+
* @inheritdoc
216212
*/
217213
public function getCalculatedRate(
218214
$productTaxClassID,

app/code/Magento/UrlRewrite/Model/UrlRewrite.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,6 @@ public function afterSave()
242242
*/
243243
public function _resetState(): void
244244
{
245-
$this->entityToCacheTagMap = [];
245+
$this->entityToCacheTagMap = [];
246246
}
247247
}

0 commit comments

Comments
 (0)