1 | <?php |
||
35 | class WhereFilter |
||
36 | { |
||
37 | /** |
||
38 | * @param array|\ArrayAccess[] $array The elements to filter through |
||
39 | * @param string $key The key value in an associative array or FrontMatter |
||
40 | * @param string $comparison The actual comparison symbols being used |
||
41 | * @param mixed $value The value we're searching for |
||
42 | * |
||
43 | * @return array |
||
44 | */ |
||
45 | 39 | public function __invoke ($array, $key, $comparison, $value) |
|
52 | |||
53 | /** |
||
54 | * @return \Twig_SimpleFilter |
||
55 | */ |
||
56 | 2 | public static function get () |
|
60 | |||
61 | /** |
||
62 | * Recursive searching calling our comparison |
||
63 | * |
||
64 | * @param array|\ArrayAccess[] $array The elements to filter through |
||
65 | * @param string $key The key value in an associative array or FrontMatter |
||
66 | * @param string $comparison The actual comparison symbols being used |
||
67 | * @param string $value The value we're searching for |
||
68 | * @param array $results The reference to where to keep the filtered elements |
||
69 | */ |
||
70 | 39 | private function search_r ($array, $key, $comparison, $value, &$results) |
|
87 | |||
88 | /** |
||
89 | * The logic for determining if an element matches the filter |
||
90 | * |
||
91 | * @param array|\ArrayAccess[] $array The elements to filter through |
||
92 | * @param string $key The key value in an associative array or FrontMatter |
||
93 | * @param string $comparison The actual comparison symbols being used |
||
94 | * @param mixed $value The value we're searching for |
||
95 | * |
||
96 | * @return bool |
||
97 | * |
||
98 | * @throws Twig_Error_Syntax |
||
99 | */ |
||
100 | 39 | private function compare ($array, $key, $comparison, $value) |
|
114 | |||
115 | /** |
||
116 | * If the comparison is == or !=, then special behavior is defined for null values |
||
117 | * |
||
118 | * @param array|\ArrayAccess[] $array The elements to filter through |
||
119 | * @param string $key The key value in an associative array or FrontMatter |
||
120 | * @param string $comparison The actual comparison symbols being used |
||
121 | * @param mixed $value The value we're searching for |
||
122 | * |
||
123 | * @return bool |
||
124 | */ |
||
125 | 39 | private function compareNullValues ($array, $key, $comparison, $value) |
|
145 | |||
146 | 38 | private function comparisonSymbol ($lhs, $comparison, $rhs) |
|
181 | |||
182 | 7 | private function contains ($haystack, $needle) |
|
189 | |||
190 | 3 | private function containsCaseInsensitive ($haystack, $needle) |
|
201 | |||
202 | 1 | private function regexMatches ($haystack, $regex) |
|
206 | } |
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
.