3
3
* Copyright © Magento, Inc. All rights reserved.
4
4
* See COPYING.txt for license details.
5
5
*/
6
+ declare (strict_types=1 );
7
+
6
8
namespace Magento \Catalog \Ui \DataProvider \Product \Form \Modifier ;
7
9
8
10
use Magento \Catalog \Model \Locator \LocatorInterface ;
@@ -313,7 +315,7 @@ protected function customizeCategoriesField(array $meta)
313
315
*/
314
316
protected function getCategoriesTree ($ filter = null )
315
317
{
316
- $ storeId = $ this ->locator ->getStore ()->getId ();
318
+ $ storeId = ( int ) $ this ->locator ->getStore ()->getId ();
317
319
318
320
$ cachedCategoriesTree = $ this ->getCacheManager ()
319
321
->load ($ this ->getCategoriesTreeCacheId ($ storeId , (string ) $ filter ));
@@ -345,7 +347,7 @@ protected function getCategoriesTree($filter = null)
345
347
* @param string $filter
346
348
* @return string
347
349
*/
348
- private function getCategoriesTreeCacheId ($ storeId , $ filter = '' )
350
+ private function getCategoriesTreeCacheId (int $ storeId , string $ filter = '' ) : string
349
351
{
350
352
return self ::CATEGORY_TREE_ID
351
353
. '_ ' . (string ) $ storeId
@@ -360,7 +362,7 @@ private function getCategoriesTreeCacheId($storeId, $filter = '')
360
362
* @return array
361
363
* @throws LocalizedException
362
364
*/
363
- private function retrieveShownCategoriesIds ($ storeId , $ filter = '' )
365
+ private function retrieveShownCategoriesIds (int $ storeId , string $ filter = '' ) : array
364
366
{
365
367
/* @var $matchingNamesCollection \Magento\Catalog\Model\ResourceModel\Category\Collection */
366
368
$ matchingNamesCollection = $ this ->categoryCollectionFactory ->create ();
@@ -396,7 +398,7 @@ private function retrieveShownCategoriesIds($storeId, $filter = '')
396
398
* @return array
397
399
* @throws LocalizedException
398
400
*/
399
- private function retrieveCategoriesTree ($ storeId , array $ shownCategoriesIds = [])
401
+ private function retrieveCategoriesTree (int $ storeId , array $ shownCategoriesIds) : array
400
402
{
401
403
/* @var $collection \Magento\Catalog\Model\ResourceModel\Category\Collection */
402
404
$ collection = $ this ->categoryCollectionFactory ->create ();
0 commit comments