1313namespace Webklex \IMAP \Query ;
1414
1515use Webklex \IMAP \Exceptions \InvalidWhereQueryCriteriaException ;
16+ use Webklex \IMAP \Exceptions \MethodNotFoundException ;
1617
1718/**
1819 * Class Query
@@ -55,7 +56,7 @@ public function __call($name, $arguments) {
5556 * @return string
5657 * @throws InvalidWhereQueryCriteriaException
5758 */
58- protected function validate_criteria ($ criteria ){
59+ protected function validate_criteria ($ criteria ) {
5960 $ criteria = strtoupper ($ criteria );
6061
6162 if (in_array ($ criteria , $ this ->available_criteria ) === false ) {
@@ -70,9 +71,8 @@ protected function validate_criteria($criteria){
7071 * @param mixed $value
7172 *
7273 * @return $this
73- * @throws InvalidWhereQueryCriteriaException
7474 */
75- public function where ($ criteria , $ value = null ){
75+ public function where ($ criteria , $ value = null ) {
7676 if (is_array ($ criteria )){
7777 foreach ($ criteria as $ arguments ){
7878 if (count ($ arguments ) == 1 ){
@@ -100,7 +100,7 @@ public function where($criteria, $value = null){
100100 *
101101 * @return $this
102102 */
103- public function orWhere (\Closure $ closure = null ){
103+ public function orWhere (\Closure $ closure = null ) {
104104 $ this ->query ->push (['OR ' ]);
105105 if ($ closure !== null ) $ closure ($ this );
106106
@@ -121,27 +121,24 @@ public function andWhere(\Closure $closure = null) {
121121
122122 /**
123123 * @return WhereQuery
124- * @throws InvalidWhereQueryCriteriaException
125124 */
126- public function whereAll (){
125+ public function whereAll () {
127126 return $ this ->where ('ALL ' );
128127 }
129128
130129 /**
131130 * @return WhereQuery
132- * @throws InvalidWhereQueryCriteriaException
133131 */
134- public function whereAnswered (){
132+ public function whereAnswered () {
135133 return $ this ->where ('ANSWERED ' );
136134 }
137135
138136 /**
139137 * @param string $value
140138 *
141139 * @return WhereQuery
142- * @throws InvalidWhereQueryCriteriaException
143140 */
144- public function whereBcc ($ value ){
141+ public function whereBcc ($ value ) {
145142 return $ this ->where ('BCC ' , $ value );
146143 }
147144
@@ -151,7 +148,7 @@ public function whereBcc($value){
151148 * @return WhereQuery
152149 * @throws \Webklex\IMAP\Exceptions\MessageSearchValidationException
153150 */
154- public function whereBefore ($ value ){
151+ public function whereBefore ($ value ) {
155152 $ date = $ this ->parse_date ($ value );
156153 return $ this ->where ('BEFORE ' , $ date );
157154 }
@@ -160,73 +157,65 @@ public function whereBefore($value){
160157 * @param string $value
161158 *
162159 * @return WhereQuery
163- * @throws InvalidWhereQueryCriteriaException
164160 */
165- public function whereBody ($ value ){
161+ public function whereBody ($ value ) {
166162 return $ this ->where ('BODY ' , $ value );
167163 }
168164
169165 /**
170166 * @param string $value
171167 *
172168 * @return WhereQuery
173- * @throws InvalidWhereQueryCriteriaException
174169 */
175- public function whereCc ($ value ){
170+ public function whereCc ($ value ) {
176171 return $ this ->where ('CC ' , $ value );
177172 }
178173
179174 /**
180175 * @return WhereQuery
181- * @throws InvalidWhereQueryCriteriaException
182176 */
183- public function whereDeleted (){
177+ public function whereDeleted () {
184178 return $ this ->where ('DELETED ' );
185179 }
186180
187181 /**
188182 * @param string $value
189183 *
190184 * @return WhereQuery
191- * @throws InvalidWhereQueryCriteriaException
192185 */
193- public function whereFlagged ($ value ){
186+ public function whereFlagged ($ value ) {
194187 return $ this ->where ('FLAGGED ' , $ value );
195188 }
196189
197190 /**
198191 * @param string $value
199192 *
200193 * @return WhereQuery
201- * @throws InvalidWhereQueryCriteriaException
202194 */
203- public function whereFrom ($ value ){
195+ public function whereFrom ($ value ) {
204196 return $ this ->where ('FROM ' , $ value );
205197 }
206198
207199 /**
208200 * @param string $value
209201 *
210202 * @return WhereQuery
211- * @throws InvalidWhereQueryCriteriaException
212203 */
213- public function whereKeyword ($ value ){
204+ public function whereKeyword ($ value ) {
214205 return $ this ->where ('KEYWORD ' , $ value );
215206 }
216207
217208 /**
218209 * @return WhereQuery
219- * @throws InvalidWhereQueryCriteriaException
220210 */
221- public function whereNew (){
211+ public function whereNew () {
222212 return $ this ->where ('NEW ' );
223213 }
224214
225215 /**
226216 * @return WhereQuery
227- * @throws InvalidWhereQueryCriteriaException
228217 */
229- public function whereOld (){
218+ public function whereOld () {
230219 return $ this ->where ('OLD ' );
231220 }
232221
@@ -236,24 +225,22 @@ public function whereOld(){
236225 * @return WhereQuery
237226 * @throws \Webklex\IMAP\Exceptions\MessageSearchValidationException
238227 */
239- public function whereOn ($ value ){
228+ public function whereOn ($ value ) {
240229 $ date = $ this ->parse_date ($ value );
241230 return $ this ->where ('ON ' , $ date );
242231 }
243232
244233 /**
245234 * @return WhereQuery
246- * @throws InvalidWhereQueryCriteriaException
247235 */
248- public function whereRecent (){
236+ public function whereRecent () {
249237 return $ this ->where ('RECENT ' );
250238 }
251239
252240 /**
253241 * @return WhereQuery
254- * @throws InvalidWhereQueryCriteriaException
255242 */
256- public function whereSeen (){
243+ public function whereSeen () {
257244 return $ this ->where ('SEEN ' );
258245 }
259246
@@ -263,7 +250,7 @@ public function whereSeen(){
263250 * @return WhereQuery
264251 * @throws \Webklex\IMAP\Exceptions\MessageSearchValidationException
265252 */
266- public function whereSince ($ value ){
253+ public function whereSince ($ value ) {
267254 $ date = $ this ->parse_date ($ value );
268255 return $ this ->where ('SINCE ' , $ date );
269256 }
@@ -272,71 +259,63 @@ public function whereSince($value){
272259 * @param string $value
273260 *
274261 * @return WhereQuery
275- * @throws InvalidWhereQueryCriteriaException
276262 */
277- public function whereSubject ($ value ){
263+ public function whereSubject ($ value ) {
278264 return $ this ->where ('SUBJECT ' , $ value );
279265 }
280266
281267 /**
282268 * @param string $value
283269 *
284270 * @return WhereQuery
285- * @throws InvalidWhereQueryCriteriaException
286271 */
287- public function whereText ($ value ){
272+ public function whereText ($ value ) {
288273 return $ this ->where ('TEXT ' , $ value );
289274 }
290275
291276 /**
292277 * @param string $value
293278 *
294279 * @return WhereQuery
295- * @throws InvalidWhereQueryCriteriaException
296280 */
297- public function whereTo ($ value ){
281+ public function whereTo ($ value ) {
298282 return $ this ->where ('TO ' , $ value );
299283 }
300284
301285 /**
302286 * @param string $value
303287 *
304288 * @return WhereQuery
305- * @throws InvalidWhereQueryCriteriaException
306289 */
307- public function whereUnkeyword ($ value ){
290+ public function whereUnkeyword ($ value ) {
308291 return $ this ->where ('UNKEYWORD ' , $ value );
309292 }
310293
311294 /**
312295 * @return WhereQuery
313- * @throws InvalidWhereQueryCriteriaException
314296 */
315- public function whereUnanswered (){
297+ public function whereUnanswered () {
316298 return $ this ->where ('UNANSWERED ' );
317299 }
318300
319301 /**
320302 * @return WhereQuery
321- * @throws InvalidWhereQueryCriteriaException
322303 */
323- public function whereUndeleted (){
304+ public function whereUndeleted () {
324305 return $ this ->where ('UNDELETED ' );
325306 }
326307
327308 /**
328309 * @return WhereQuery
329- * @throws InvalidWhereQueryCriteriaException
330310 */
331- public function whereUnflagged (){
311+ public function whereUnflagged () {
332312 return $ this ->where ('UNFLAGGED ' );
333313 }
334314
335315 /**
336316 * @return WhereQuery
337- * @throws InvalidWhereQueryCriteriaException
338317 */
339- public function whereUnseen (){
318+ public function whereUnseen () {
340319 return $ this ->where ('UNSEEN ' );
341320 }
342321}
0 commit comments