Skip to content

Commit 72dc2dd

Browse files
committed
Code refactoring.
1 parent 5025776 commit 72dc2dd

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

app/code/Magento/CatalogSearch/Model/Search/Category.php

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,11 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
7+
68
namespace Magento\CatalogSearch\Model\Search;
79
/**
810
* Search model for backend search
9-
*
10-
* @method Category setQuery(string $query)
11-
* @method string|null getQuery()
12-
* @method bool hasQuery()
13-
* @method Category setStart(int $startPosition)
14-
* @method int|null getStart()
15-
* @method bool hasStart()
16-
* @method Category setLimit(int $limit)
17-
* @method int|null getLimit()
18-
* @method bool hasLimit()
19-
* @method Category setResults(array $results)
20-
* @method array getResults()
21-
* @api
2211
*/
2312
class Category extends \Magento\Framework\DataObject
2413
{
@@ -106,7 +95,7 @@ public function load()
10695
$searchResults = $this->categoryRepository->getList($searchCriteria);
10796

10897
foreach ($searchResults->getItems() as $category) {
109-
$description = strip_tags($category->getDescription());
98+
$description = $category->getDescription() ? strip_tags($category->getDescription()) : '';
11099
$result[] = [
111100
'id' => 'category/1/' . $category->getId(),
112101
'type' => __('Category'),

0 commit comments

Comments
 (0)