1 | <?php |
||
52 | class IsDotNotationPath |
||
53 | { |
||
54 | use LookupMethodByType; |
||
55 | |||
56 | /** |
||
57 | * do we have a dot.notation string at all? |
||
58 | * |
||
59 | * @param mixed $item |
||
60 | * the item to examine |
||
61 | * @return boolean |
||
62 | * TRUE if the string is in dot.notation |
||
63 | * FALSE otherwise |
||
64 | */ |
||
65 | public function __invoke($item) |
||
69 | |||
70 | /** |
||
71 | * do we have a dot.notation string at all? |
||
72 | * |
||
73 | * @param mixed $item |
||
74 | * the item to examine |
||
75 | * @return boolean |
||
76 | * TRUE if the string is in dot.notation |
||
77 | * FALSE otherwise |
||
78 | */ |
||
79 | public static function check($item) |
||
84 | |||
85 | /** |
||
86 | * do we have a dot.notation string at all? |
||
87 | * |
||
88 | * @deprecated since 2.3.0 |
||
89 | * @codeCoverageIgnore |
||
90 | * |
||
91 | * @param mixed $item |
||
92 | * the item to examine |
||
93 | * @return boolean |
||
94 | * TRUE if the string is in dot.notation |
||
95 | * FALSE otherwise |
||
96 | */ |
||
97 | public static function in($item) |
||
101 | |||
102 | /** |
||
103 | * do we have a dot.notation string at all? |
||
104 | * |
||
105 | * @deprecated since 2.3.0 |
||
106 | * @codeCoverageIgnore |
||
107 | * |
||
108 | * @param string $item |
||
109 | * the item to examine |
||
110 | * @return boolean |
||
111 | * TRUE if the string is in dot.notation |
||
112 | * FALSE otherwise |
||
113 | */ |
||
114 | public static function inString($item) |
||
118 | |||
119 | /** |
||
120 | * do we have a dot.notation string at all? |
||
121 | * |
||
122 | * @param string $item |
||
123 | * the item to examine |
||
124 | * @return boolean |
||
125 | * TRUE if the string is in dot.notation |
||
126 | * FALSE otherwise |
||
127 | */ |
||
128 | public static function checkString($item) |
||
141 | |||
142 | /** |
||
143 | * called when there's no entry in our dispatch table that matches |
||
144 | * $item's data type |
||
145 | * |
||
146 | * @param mixed $item |
||
147 | * the item that we cannot process |
||
148 | * @return void |
||
149 | */ |
||
150 | public static function nothingMatchesTheInputType($item) |
||
154 | |||
155 | /** |
||
156 | * do we have a dot, and is it somewhere we're happy with? |
||
157 | * |
||
158 | * @param string $item |
||
159 | * @return boolean |
||
160 | * FALSE if there is no '.' anywhere |
||
161 | * FALSE if the first '.' is at the end of the string |
||
162 | * TRUE otherwise |
||
163 | */ |
||
164 | private static function hasDotInAcceptablePlace($item) |
||
182 | |||
183 | /** |
||
184 | * our lookup table of which method to call for which supported data type |
||
185 | * @var array |
||
186 | */ |
||
187 | private static $dispatchTable = [ |
||
188 | 'String' => 'checkString', |
||
189 | ]; |
||
190 | } |
||
191 |