Passed
Push — trunk ( 325349...f71779 )
by Christian
12:37 queued 16s
created

SearchFieldConfig::getField()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 1
b 0
f 0
1
<?php declare(strict_types=1);
2
3
namespace Shopware\Elasticsearch\Product;
4
5
use Shopware\Core\Framework\Log\Package;
6
7
#[Package('core')]
8
class SearchFieldConfig
9
{
10
    public function __construct(
11
        private readonly string $field,
12
        private readonly int $ranking,
13
        private readonly bool $tokenize
14
    ) {
15
    }
16
17
    public function tokenize(): bool
18
    {
19
        return $this->tokenize;
20
    }
21
22
    public function getRanking(): int
23
    {
24
        return $this->ranking;
25
    }
26
27
    public function getField(): string
28
    {
29
        return $this->field;
30
    }
31
32
    public function isCustomField(): bool
33
    {
34
        return str_contains($this->field, 'customFields');
35
    }
36
}
37