Skip to content

Commit 53b0f19

Browse files
committed
Merge remote-tracking branch 'githubce/2.3-develop' into MAGETWO-64282
2 parents 929f82e + 8fd89cf commit 53b0f19

File tree

62 files changed

+1840
-341
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+1840
-341
lines changed

app/code/Magento/Bundle/Model/Product/Type.php

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66

77
namespace Magento\Bundle\Model\Product;
88

9-
use Magento\Framework\App\ObjectManager;
9+
use Magento\Bundle\Model\ResourceModel\Selection\Collection as Selections;
10+
use Magento\Bundle\Model\ResourceModel\Selection\Collection\FilterApplier as SelectionCollectionFilterApplier;
1011
use Magento\Catalog\Api\ProductRepositoryInterface;
12+
use Magento\Framework\App\ObjectManager;
13+
use Magento\Framework\EntityManager\MetadataPool;
1114
use Magento\Framework\Pricing\PriceCurrencyInterface;
1215
use Magento\Framework\Serialize\Serializer\Json;
13-
use Magento\Framework\EntityManager\MetadataPool;
14-
use Magento\Bundle\Model\ResourceModel\Selection\Collection\FilterApplier as SelectionCollectionFilterApplier;
15-
use Magento\Bundle\Model\ResourceModel\Selection\Collection as Selections;
1616

1717
/**
1818
* Bundle Type Model
@@ -537,7 +537,7 @@ public function updateQtyOption($options, \Magento\Framework\DataObject $option,
537537
foreach ($options as $quoteItemOption) {
538538
if ($quoteItemOption->getCode() == 'selection_qty_' . $selection->getSelectionId()) {
539539
if ($optionUpdateFlag) {
540-
$quoteItemOption->setValue(intval($quoteItemOption->getValue()));
540+
$quoteItemOption->setValue((int) $quoteItemOption->getValue());
541541
} else {
542542
$quoteItemOption->setValue($value);
543543
}
@@ -625,6 +625,7 @@ public function isSalable($product)
625625

626626
/**
627627
* Prepare product and its configuration to be added to some products list.
628+
*
628629
* Perform standard preparation process and then prepare of bundle selections options.
629630
*
630631
* @param \Magento\Framework\DataObject $buyRequest
@@ -790,6 +791,8 @@ protected function _prepareProduct(\Magento\Framework\DataObject $buyRequest, $p
790791
}
791792

792793
/**
794+
* Cast array values to int
795+
*
793796
* @param array $array
794797
* @return int[]|int[][]
795798
*/
@@ -809,6 +812,8 @@ private function recursiveIntval(array $array)
809812
}
810813

811814
/**
815+
* Convert multi dimensional array to flat
816+
*
812817
* @param array $array
813818
* @return int[]
814819
*/
@@ -920,8 +925,7 @@ public function getOptionsByIds($optionIds, $product)
920925
}
921926

922927
/**
923-
* Prepare additional options/information for order item which will be
924-
* created from this product
928+
* Prepare additional options/information for order item which will be created from this product
925929
*
926930
* @param \Magento\Catalog\Model\Product $product
927931
* @return array
@@ -987,6 +991,7 @@ public function getOrderOptions($product)
987991

988992
/**
989993
* Sort selections method for usort function
994+
*
990995
* Sort selections by option position, selection position and selection id
991996
*
992997
* @param \Magento\Catalog\Model\Product $firstItem
@@ -1050,6 +1055,7 @@ public function getForceChildItemQtyChanges($product)
10501055

10511056
/**
10521057
* Retrieve additional searchable data from type instance
1058+
*
10531059
* Using based on product id and store_id data
10541060
*
10551061
* @param \Magento\Catalog\Model\Product $product
@@ -1118,6 +1124,7 @@ public function checkProductBuyState($product)
11181124

11191125
/**
11201126
* Retrieve products divided into groups required to purchase
1127+
*
11211128
* At least one product in each group has to be purchased
11221129
*
11231130
* @param \Magento\Catalog\Model\Product $product
@@ -1214,6 +1221,8 @@ public function getIdentities(\Magento\Catalog\Model\Product $product)
12141221
}
12151222

12161223
/**
1224+
* Returns selection qty
1225+
*
12171226
* @param \Magento\Framework\DataObject $selection
12181227
* @param int[] $qtys
12191228
* @param int $selectionOptionId
@@ -1232,6 +1241,8 @@ protected function getQty($selection, $qtys, $selectionOptionId)
12321241
}
12331242

12341243
/**
1244+
* Returns qty
1245+
*
12351246
* @param \Magento\Catalog\Model\Product $product
12361247
* @param \Magento\Framework\DataObject $selection
12371248
* @return float|int
@@ -1249,6 +1260,8 @@ protected function getBeforeQty($product, $selection)
12491260
}
12501261

12511262
/**
1263+
* Validate required options
1264+
*
12521265
* @param \Magento\Catalog\Model\Product $product
12531266
* @param bool $isStrictProcessMode
12541267
* @param \Magento\Bundle\Model\ResourceModel\Option\Collection $optionsCollection
@@ -1270,6 +1283,8 @@ protected function checkIsAllRequiredOptions($product, $isStrictProcessMode, $op
12701283
}
12711284

12721285
/**
1286+
* Check if selection is salable
1287+
*
12731288
* @param \Magento\Bundle\Model\ResourceModel\Selection\Collection $selections
12741289
* @param bool $skipSaleableCheck
12751290
* @param \Magento\Bundle\Model\ResourceModel\Option\Collection $optionsCollection
@@ -1300,6 +1315,8 @@ protected function checkSelectionsIsSale($selections, $skipSaleableCheck, $optio
13001315
}
13011316

13021317
/**
1318+
* Validate result
1319+
*
13031320
* @param array $_result
13041321
* @return void
13051322
* @throws \Magento\Framework\Exception\LocalizedException
@@ -1318,6 +1335,8 @@ protected function checkIsResult($_result)
13181335
}
13191336

13201337
/**
1338+
* Merge selections with options
1339+
*
13211340
* @param \Magento\Catalog\Model\Product\Option[] $options
13221341
* @param \Magento\Framework\DataObject[] $selections
13231342
* @return \Magento\Framework\DataObject[]

app/code/Magento/Catalog/Block/Product/Widget/NewWidget.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ public function getCacheKeyInfo()
139139
[
140140
$this->getDisplayType(),
141141
$this->getProductsPerPage(),
142-
intval($this->getRequest()->getParam($this->getData('page_var_name'), 1)),
142+
(int) $this->getRequest()->getParam($this->getData('page_var_name'), 1),
143143
$this->serializer->serialize($this->getRequest()->getParams())
144144
]
145145
);

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

Lines changed: 46 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ protected function _construct()
300300
}
301301

302302
/**
303-
* {@inheritdoc}
303+
* @inheritdoc
304304
*/
305305
protected function getCustomAttributesCodes()
306306
{
@@ -312,6 +312,8 @@ protected function getCustomAttributesCodes()
312312
}
313313

314314
/**
315+
* Returns model resource
316+
*
315317
* @throws \Magento\Framework\Exception\LocalizedException
316318
* @return \Magento\Catalog\Model\ResourceModel\Category
317319
* @deprecated because resource models should be used directly
@@ -648,6 +650,8 @@ public function formatUrlKey($str)
648650
}
649651

650652
/**
653+
* Returns image url
654+
*
651655
* @param string $attributeCode
652656
* @return bool|string
653657
* @throws \Magento\Framework\Exception\LocalizedException
@@ -708,7 +712,7 @@ public function getParentId()
708712
return $parentId;
709713
}
710714
$parentIds = $this->getParentIds();
711-
return intval(array_pop($parentIds));
715+
return (int) array_pop($parentIds);
712716
}
713717

714718
/**
@@ -796,6 +800,7 @@ public function getChildren($recursive = false, $isActive = true, $sortByPositio
796800

797801
/**
798802
* Retrieve Stores where isset category Path
803+
*
799804
* Return comma separated string
800805
*
801806
* @return string
@@ -826,6 +831,7 @@ public function checkId($id)
826831

827832
/**
828833
* Get array categories ids which are part of category path
834+
*
829835
* Result array contain id of current category because it is part of the path
830836
*
831837
* @return array
@@ -1029,7 +1035,8 @@ public function getAvailableSortBy()
10291035

10301036
/**
10311037
* Retrieve Available Product Listing Sort By
1032-
* code as key, value - name
1038+
*
1039+
* Code as key, value - name
10331040
*
10341041
* @return array
10351042
*/
@@ -1150,6 +1157,8 @@ public function getIdentities()
11501157
}
11511158

11521159
/**
1160+
* Returns path
1161+
*
11531162
* @codeCoverageIgnoreStart
11541163
* @return string|null
11551164
*/
@@ -1159,6 +1168,8 @@ public function getPath()
11591168
}
11601169

11611170
/**
1171+
* Returns position
1172+
*
11621173
* @return int|null
11631174
*/
11641175
public function getPosition()
@@ -1167,6 +1178,8 @@ public function getPosition()
11671178
}
11681179

11691180
/**
1181+
* Returns children count
1182+
*
11701183
* @return int
11711184
*/
11721185
public function getChildrenCount()
@@ -1175,6 +1188,8 @@ public function getChildrenCount()
11751188
}
11761189

11771190
/**
1191+
* Returns created at
1192+
*
11781193
* @return string|null
11791194
*/
11801195
public function getCreatedAt()
@@ -1183,6 +1198,8 @@ public function getCreatedAt()
11831198
}
11841199

11851200
/**
1201+
* Returns updated at
1202+
*
11861203
* @return string|null
11871204
*/
11881205
public function getUpdatedAt()
@@ -1191,6 +1208,8 @@ public function getUpdatedAt()
11911208
}
11921209

11931210
/**
1211+
* Returns is active
1212+
*
11941213
* @return bool
11951214
* @SuppressWarnings(PHPMD.BooleanGetMethodName)
11961215
*/
@@ -1200,6 +1219,8 @@ public function getIsActive()
12001219
}
12011220

12021221
/**
1222+
* Returns category id
1223+
*
12031224
* @return int|null
12041225
*/
12051226
public function getCategoryId()
@@ -1208,6 +1229,8 @@ public function getCategoryId()
12081229
}
12091230

12101231
/**
1232+
* Returns display mode
1233+
*
12111234
* @return string|null
12121235
*/
12131236
public function getDisplayMode()
@@ -1216,6 +1239,8 @@ public function getDisplayMode()
12161239
}
12171240

12181241
/**
1242+
* Returns is include in menu
1243+
*
12191244
* @return bool|null
12201245
*/
12211246
public function getIncludeInMenu()
@@ -1224,6 +1249,8 @@ public function getIncludeInMenu()
12241249
}
12251250

12261251
/**
1252+
* Returns url key
1253+
*
12271254
* @return string|null
12281255
*/
12291256
public function getUrlKey()
@@ -1232,6 +1259,8 @@ public function getUrlKey()
12321259
}
12331260

12341261
/**
1262+
* Returns children data
1263+
*
12351264
* @return \Magento\Catalog\Api\Data\CategoryTreeInterface[]|null
12361265
*/
12371266
public function getChildrenData()
@@ -1347,6 +1376,8 @@ public function setLevel($level)
13471376
}
13481377

13491378
/**
1379+
* Set updated at
1380+
*
13501381
* @param string $updatedAt
13511382
* @return $this
13521383
*/
@@ -1356,6 +1387,8 @@ public function setUpdatedAt($updatedAt)
13561387
}
13571388

13581389
/**
1390+
* Set created at
1391+
*
13591392
* @param string $createdAt
13601393
* @return $this
13611394
*/
@@ -1365,6 +1398,8 @@ public function setCreatedAt($createdAt)
13651398
}
13661399

13671400
/**
1401+
* Set path
1402+
*
13681403
* @param string $path
13691404
* @return $this
13701405
*/
@@ -1374,6 +1409,8 @@ public function setPath($path)
13741409
}
13751410

13761411
/**
1412+
* Set available sort by
1413+
*
13771414
* @param string[]|string $availableSortBy
13781415
* @return $this
13791416
*/
@@ -1383,6 +1420,8 @@ public function setAvailableSortBy($availableSortBy)
13831420
}
13841421

13851422
/**
1423+
* Set include in menu
1424+
*
13861425
* @param bool $includeInMenu
13871426
* @return $this
13881427
*/
@@ -1403,6 +1442,8 @@ public function setProductCount($productCount)
14031442
}
14041443

14051444
/**
1445+
* Set children data
1446+
*
14061447
* @param \Magento\Catalog\Api\Data\CategoryTreeInterface[] $childrenData
14071448
* @return $this
14081449
*/
@@ -1412,7 +1453,7 @@ public function setChildrenData(array $childrenData = null)
14121453
}
14131454

14141455
/**
1415-
* {@inheritdoc}
1456+
* @inheritdoc
14161457
*
14171458
* @return \Magento\Catalog\Api\Data\CategoryExtensionInterface|null
14181459
*/
@@ -1422,7 +1463,7 @@ public function getExtensionAttributes()
14221463
}
14231464

14241465
/**
1425-
* {@inheritdoc}
1466+
* @inheritdoc
14261467
*
14271468
* @param \Magento\Catalog\Api\Data\CategoryExtensionInterface $extensionAttributes
14281469
* @return $this

0 commit comments

Comments
 (0)