-
-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathIterableFilterHandlerInterface.php
More file actions
36 lines (31 loc) · 987 Bytes
/
IterableFilterHandlerInterface.php
File metadata and controls
36 lines (31 loc) · 987 Bytes
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
28
29
30
31
32
33
34
35
36
<?php
declare(strict_types=1);
namespace Yiisoft\Data\Reader\Iterable;
use Yiisoft\Data\Reader\FilterInterface;
/**
* Iterable filter handler checks whether an item matches criteria defined
* in the filter with the same operator.
*/
interface IterableFilterHandlerInterface
{
/**
* Check whether an item matches iterable filter handlers
* for the filters with matching operator active.
*
* @param array|object $item Item to check.
* @param FilterInterface $filter Matched filter.
*
* @return bool Whether item matches the filter.
*/
public function match(array|object $item, FilterInterface $filter, Context $context): bool;
/**
* Get matching filter class name.
*
* If the filter is active, a corresponding handler will be used during matching.
*
* @return string The filter class name.
*
* @psalm-return class-string<FilterInterface>
*/
public function getFilterClass(): string;
}