aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Search/Filter/StringFilter.php
blob: 6944a7803f3087a6a0732610f1f013f7562495b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php

declare(strict_types=1);

/**
 * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
 * SPDX-License-Identifier: AGPL-3.0-or-later
 */

namespace OC\Search\Filter;

use InvalidArgumentException;
use OCP\Search\IFilter;

class StringFilter implements IFilter {
	public function __construct(
		private string $value,
	) {
		if ($value === '') {
			throw new InvalidArgumentException('String filter can’t be empty');
		}
	}

	public function get(): string {
		return $this->value;
	}
}