Skip to content

Commit 4cd5cd2

Browse files
committed
Fix phpStan
1 parent 890206a commit 4cd5cd2

File tree

1 file changed

+6
-3
lines changed
  • app/code/Magento/Catalog/Controller/Category

1 file changed

+6
-3
lines changed

app/code/Magento/Catalog/Controller/Category/View.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Magento\Catalog\Api\CategoryRepositoryInterface;
1010
use Magento\Catalog\Helper\Category as CategoryHelper;
1111
use Magento\Catalog\Model\Category;
12+
use Magento\Catalog\Model\Category\Attribute\LayoutUpdateManager;
1213
use Magento\Catalog\Model\Design;
1314
use Magento\Catalog\Model\Layer\Resolver;
1415
use Magento\Catalog\Model\Product\ProductList\ToolbarMemorizer;
@@ -30,7 +31,6 @@
3031
use Magento\Framework\View\Result\PageFactory;
3132
use Magento\Store\Model\StoreManagerInterface;
3233
use Psr\Log\LoggerInterface;
33-
use Magento\Catalog\Model\Category\Attribute\LayoutUpdateManager;
3434

3535
/**
3636
* View a category on storefront. Needs to be accessible by POST because of the store switching.
@@ -208,8 +208,10 @@ protected function _initCategory()
208208
* @return ResultInterface
209209
* @throws NoSuchEntityException
210210
*/
211-
public function execute()
211+
public function execute(): ?ResultInterface
212212
{
213+
$result = null;
214+
213215
if ($this->_request->getParam(ActionInterface::PARAM_NAME_URL_ENCODED)) {
214216
return $this->resultRedirectFactory->create()->setUrl($this->_redirect->getRedirectUrl());
215217
}
@@ -251,8 +253,9 @@ public function execute()
251253

252254
return $page;
253255
} elseif (!$this->getResponse()->isRedirect()) {
254-
return $this->resultForwardFactory->create()->forward('noroute');
256+
$result = $this->resultForwardFactory->create()->forward('noroute');
255257
}
258+
return $result;
256259
}
257260

258261
/**

0 commit comments

Comments
 (0)