| Conditions | 8 |
| Paths | 8 |
| Total Lines | 20 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 46 | public function passes( $setOfRules ) |
||
| 47 | { |
||
| 48 | if ( is_string( $setOfRules ) || is_array( $setOfRules ) ) |
||
|
|
|||
| 49 | { |
||
| 50 | $validator = NULL; |
||
| 51 | if ( is_string( $setOfRules ) && method_exists( $this, $setOfRules ) ) $validator = $this->validator->make( $this->data, $this->{$setOfRules}() ); |
||
| 52 | else if ( is_array( $setOfRules ) ) $validator = $this->validator->make( $this->data, $setOfRules ); |
||
| 53 | else |
||
| 54 | { |
||
| 55 | throw new ValidationFunctionDoesNotExist(); |
||
| 56 | } |
||
| 57 | |||
| 58 | if ( !is_null( $validator ) ) |
||
| 59 | { |
||
| 60 | if( !$validator->fails() ) return TRUE; |
||
| 61 | else $this->errors = $validator->messages()->getMessages(); |
||
| 62 | } |
||
| 63 | } |
||
| 64 | |||
| 65 | return FALSE; |
||
| 66 | } |
||
| 88 | } |