Skip to content

Commit

Permalink
fix PHP stan
Browse files Browse the repository at this point in the history
  • Loading branch information
lukmzig committed Apr 10, 2024
1 parent a123edc commit 5595a9c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
use Pimcore\Bundle\GenericDataIndexBundle\Model\Search\DataObject\DataObjectSearchInterface;
use Pimcore\Bundle\GenericDataIndexBundle\Model\Search\DataObject\SearchResult\DataObjectSearchResult;
use Pimcore\Bundle\GenericDataIndexBundle\Model\Search\DataObject\SearchResult\DataObjectSearchResultItem;
use Pimcore\Bundle\GenericDataIndexBundle\Model\Search\Interfaces\SearchInterface;
use Pimcore\Bundle\GenericDataIndexBundle\Model\Search\Modifier\Filter\Basic\IdFilter;
use Pimcore\Bundle\GenericDataIndexBundle\Permission\Workspace\DataObjectWorkspace;
use Pimcore\Bundle\GenericDataIndexBundle\SearchIndexAdapter\Search\Pagination\PaginationInfoServiceInterface;
Expand All @@ -46,18 +45,18 @@ public function __construct(
/**
* @throws DataObjectSearchException
*/
public function search(SearchInterface|DataObjectSearchInterface $dataObjectSearch): DataObjectSearchResult
public function search(DataObjectSearchInterface $dataObjectSearch): DataObjectSearchResult
{
$indexContext = $dataObjectSearch->getClassDefinition() ?: DataObjectIndexHandler::DATA_OBJECT_INDEX_ALIAS;

$dataObjectSearch = $this->searchHelper->addSearchRestrictions(
$search = $this->searchHelper->addSearchRestrictions(
search: $dataObjectSearch,
userPermission: UserPermissionTypes::OBJECTS->value,
workspaceType: DataObjectWorkspace::WORKSPACE_TYPE
);

$searchResult = $this->searchHelper->performSearch(
search: $dataObjectSearch,
search: $search,
indexName: $this->dataObjectTypeAdapter->getAliasIndexName($indexContext)
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ interface DataObjectSearchServiceInterface
/**
* @throws DataObjectSearchException
*/
public function search(SearchInterface|DataObjectSearchInterface $dataObjectSearch): DataObjectSearchResult;
public function search(DataObjectSearchInterface $dataObjectSearch): DataObjectSearchResult;

/**
* @throws Exception
Expand Down

0 comments on commit 5595a9c

Please sign in to comment.