Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
n/a
0 / 0
n/a
0 / 0
CRAP
n/a
0 / 0
1<?php
2declare(strict_types=1);
3/**
4 * Pop PHP Framework (https://www.popphp.org/)
5 *
6 * @link       https://github.com/popphp/popphp-framework
7 * @author     Nick Sagona, III <nick@popphp.org>
8 * @copyright  Copyright (c) 2009-2026 Nick Sagona, III
9 * @license    https://www.popphp.org/license     New BSD License
10 */
11
12/**
13 * @namespace
14 */
15namespace Pop\Filter;
16
17use Pop\Utils\CallableObject;
18
19/**
20 * Filter interface
21 *
22 * @category   Pop
23 * @package    Pop\Filter
24 * @author     Nick Sagona, III <nick@popphp.org>
25 * @copyright  Copyright (c) 2009-2026 Nick Sagona, III
26 * @license    https://www.popphp.org/license     New BSD License
27 * @version    5.0.0
28 */
29interface FilterInterface
30{
31
32    /**
33     * Set callable
34     *
35     * @param  mixed $callable
36     * @return FilterInterface
37     */
38    public function setCallable(mixed $callable): FilterInterface;
39
40    /**
41     * Set params
42     *
43     * @param  mixed $params
44     * @return FilterInterface
45     */
46    public function setParams(mixed $params): FilterInterface;
47
48    /**
49     * Set exclude by name
50     *
51     * @param  mixed $excludeByName
52     * @return FilterInterface
53     */
54    public function setExcludeByName(mixed $excludeByName): FilterInterface;
55
56    /**
57     * Set exclude by type
58     *
59     * @param  mixed $excludeByType
60     * @return FilterInterface
61     */
62    public function setExcludeByType(mixed $excludeByType): FilterInterface;
63
64    /**
65     * Get callable
66     *
67     * @return ?CallableObject
68     */
69    public function getCallable(): ?CallableObject;
70
71    /**
72     * Remove callable
73     *
74     * @return FilterInterface
75     */
76    public function removeCallable(): FilterInterface;
77
78    /**
79     * Get params
80     *
81     * @return array
82     */
83    public function getParams(): array;
84
85    /**
86     * Get exclude by name
87     *
88     * @return array
89     */
90    public function getExcludeByName(): array;
91
92    /**
93     * Get exclude by type
94     *
95     * @return array
96     */
97    public function getExcludeByType(): array;
98
99    /**
100     * Has callable
101     *
102     * @return bool
103     */
104    public function hasCallable(): bool;
105
106    /**
107     * Has params
108     *
109     * @return bool
110     */
111    public function hasParams(): bool;
112
113    /**
114     * Has exclude by name
115     *
116     * @return bool
117     */
118    public function hasExcludeByName(): bool;
119
120    /**
121     * Has exclude by type
122     *
123     * @return bool
124     */
125    public function hasExcludeByType(): bool;
126
127    /**
128     * Filter value
129     *
130     * @param  mixed   $value
131     * @param  ?string $name
132     * @param  mixed   $type
133     * @return mixed
134     */
135    public function filter(mixed $value, ?string $name = null, mixed $type = null): mixed;
136
137}