1 | <?php |
||
9 | class WhereFilter |
||
10 | { |
||
11 | /** |
||
12 | * @param array|\ArrayAccess[] $array The elements to filter through |
||
13 | * @param string $key The key value in an associative array or FrontMatter |
||
14 | * @param string $comparison The actual comparison symbols being used |
||
15 | * @param mixed $value The value we're searching for |
||
16 | * |
||
17 | * @return array |
||
18 | */ |
||
19 | 21 | public function __invoke ($array, $key, $comparison, $value) |
|
26 | |||
27 | /** |
||
28 | * @return \Twig_SimpleFilter |
||
29 | */ |
||
30 | 2 | public static function get () |
|
34 | |||
35 | /** |
||
36 | * Recursive searching calling our comparison |
||
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 string $value The value we're searching for |
||
42 | * @param array $results The reference to where to keep the filtered elements |
||
43 | */ |
||
44 | 21 | private function search_r ($array, $key, $comparison, $value, &$results) |
|
61 | |||
62 | /** |
||
63 | * The logic for determining if an element matches the filter |
||
64 | * |
||
65 | * @param array|\ArrayAccess[] $array The elements to filter through |
||
66 | * @param string $key The key value in an associative array or FrontMatter |
||
67 | * @param string $comparison The actual comparison symbols being used |
||
68 | * @param mixed $value The value we're searching for |
||
69 | * |
||
70 | * @return bool |
||
71 | * |
||
72 | * @throws Twig_Error_Syntax |
||
73 | */ |
||
74 | 21 | private function compare ($array, $key, $comparison, $value) |
|
96 | |||
97 | 2 | private function contains ($haystack, $needle) |
|
102 | } |
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
.