1 | <?php |
||
33 | class WhereFilter |
||
34 | { |
||
35 | /** |
||
36 | * @param array|\ArrayAccess[] $array The elements to filter through |
||
37 | * @param string $key The key value in an associative array or FrontMatter |
||
38 | * @param string $comparison The actual comparison symbols being used |
||
39 | * @param mixed $value The value we're searching for |
||
40 | * |
||
41 | * @return array |
||
42 | */ |
||
43 | 39 | public function __invoke($array, $key, $comparison, $value) |
|
50 | |||
51 | /** |
||
52 | * @return \Twig_SimpleFilter |
||
53 | */ |
||
54 | 4 | public static function get() |
|
58 | |||
59 | /** |
||
60 | * Recursive searching calling our comparison. |
||
61 | * |
||
62 | * @param array|\ArrayAccess[] $array The elements to filter through |
||
63 | * @param string $key The key value in an associative array or FrontMatter |
||
64 | * @param string $comparison The actual comparison symbols being used |
||
65 | * @param string $value The value we're searching for |
||
66 | * @param array $results The reference to where to keep the filtered elements |
||
67 | */ |
||
68 | 39 | private function search_r($array, $key, $comparison, $value, &$results) |
|
85 | |||
86 | /** |
||
87 | * The logic for determining if an element matches the filter. |
||
88 | * |
||
89 | * @param array|\ArrayAccess[] $array The elements to filter through |
||
90 | * @param string $key The key value in an associative array or FrontMatter |
||
91 | * @param string $comparison The actual comparison symbols being used |
||
92 | * @param mixed $value The value we're searching for |
||
93 | * |
||
94 | * @throws Twig_Error_Syntax |
||
95 | * |
||
96 | * @return bool |
||
97 | */ |
||
98 | 39 | private function compare($array, $key, $comparison, $value) |
|
112 | |||
113 | /** |
||
114 | * If the comparison is == or !=, then special behavior is defined for null values. |
||
115 | * |
||
116 | * @param array|\ArrayAccess[] $array The elements to filter through |
||
117 | * @param string $key The key value in an associative array or FrontMatter |
||
118 | * @param string $comparison The actual comparison symbols being used |
||
119 | * @param mixed $value The value we're searching for |
||
120 | * |
||
121 | * @return bool |
||
122 | */ |
||
123 | 39 | private function compareNullValues($array, $key, $comparison, $value) |
|
149 | |||
150 | 38 | private function comparisonSymbol($lhs, $comparison, $rhs) |
|
185 | |||
186 | 7 | private function contains($haystack, $needle) |
|
192 | |||
193 | 3 | private function containsCaseInsensitive($haystack, $needle) |
|
204 | |||
205 | 1 | private function regexMatches($haystack, $regex) |
|
209 | } |
||
210 |
This check looks for method names that are not written in camelCase.
In camelCase names are written without any punctuation, the start of each new word being marked by a capital letter. Thus the name database connection seeker becomes
databaseConnectionSeeker
.