| Total Complexity | 5 |
| Total Lines | 48 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | final class SearchableAttribute implements SettingContract |
||
| 23 | { |
||
| 24 | /** |
||
| 25 | * @var string[] |
||
| 26 | */ |
||
| 27 | private static $unsearchableAttributesKeys = [ |
||
| 28 | 'id', |
||
| 29 | '*_id', |
||
| 30 | 'id_*', |
||
| 31 | '*ed_at', |
||
| 32 | '*_count', |
||
| 33 | 'count_*', |
||
| 34 | 'number_*', |
||
| 35 | '*_number', |
||
| 36 | '*image*', |
||
| 37 | '*url*', |
||
| 38 | '*link*', |
||
| 39 | '*password*', |
||
| 40 | '*token*', |
||
| 41 | '*hash*', |
||
| 42 | ]; |
||
| 43 | |||
| 44 | /** |
||
| 45 | * @var string[] |
||
| 46 | */ |
||
| 47 | private static $unsearchableAttributesValues = [ |
||
| 48 | 'http://*', |
||
| 49 | 'https://*', |
||
| 50 | ]; |
||
| 51 | |||
| 52 | /** |
||
| 53 | * Checks if the given key/value is a 'searchableAttributes'. |
||
| 54 | * |
||
| 55 | * @param string $key |
||
| 56 | * @param array|null|string $value |
||
| 57 | * @param array $searchableAttributes |
||
| 58 | * |
||
| 59 | * @return array |
||
| 60 | */ |
||
| 61 | 4 | public function getValue(string $key, $value, array $searchableAttributes): array |
|
| 72 |