Passed
Push — 6.4 ( be76f2...e19c4d )
by Christian
14:08 queued 13s
created

AbstractAdminIndexer::mapping()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php declare(strict_types=1);
2
3
namespace Shopware\Elasticsearch\Admin\Indexer;
4
5
use ONGR\ElasticsearchDSL\Search;
6
use Shopware\Core\Framework\Context;
7
use Shopware\Core\Framework\DataAbstractionLayer\Dbal\Common\IterableQuery;
8
use Shopware\Core\Framework\DataAbstractionLayer\Entity;
9
use Shopware\Core\Framework\DataAbstractionLayer\EntityCollection;
10
use Shopware\Core\Framework\Log\Package;
11
12
/**
13
 * @internal
14
 */
15
#[Package('system-settings')]
16
abstract class AbstractAdminIndexer
17
{
18
    abstract public function getDecorated(): self;
19
20
    abstract public function getName(): string;
21
22
    abstract public function getEntity(): string;
23
24
    /**
25
     * @param array<string, array<string, array<string, string>>> $mapping
26
     *
27
     * @return array<string, array<string, array<string, string>>>
28
     */
29
    public function mapping(array $mapping): array
30
    {
31
        return $mapping;
32
    }
33
34
    abstract public function getIterator(): IterableQuery;
35
36
    /**
37
     * @param array<string>|array<int, array<string>> $ids
38
     *
39
     * @return array<string, array<string, string>>
40
     */
41
    abstract public function fetch(array $ids): array;
42
43
    /**
44
     * @param array<string, mixed> $result
45
     *
46
     * @return array{total:int, data:EntityCollection<Entity>}
0 ignored issues
show
Documentation Bug introduced by
The doc comment array{total:int, data:EntityCollection<Entity>} at position 8 could not be parsed: Expected '}' at position 8, but found 'EntityCollection'.
Loading history...
47
     *
48
     * Return EntityCollection<Entity> and their total by ids in the result parameter
49
     */
50
    abstract public function globalData(array $result, Context $context): array;
51
52
    public function globalCriteria(string $term, Search $criteria): Search
0 ignored issues
show
Unused Code introduced by
The parameter $term is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

52
    public function globalCriteria(/** @scrutinizer ignore-unused */ string $term, Search $criteria): Search

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
53
    {
54
        return $criteria;
55
    }
56
}
57