| Conditions | 2 |
| Paths | 2 |
| Total Lines | 24 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | public static function fromName($name) : Validator |
||
| 14 | { |
||
| 15 | $validatorClass = 'Sensorario' |
||
| 16 | .'\\Resources' |
||
| 17 | .'\\Validators' |
||
| 18 | .'\\Validators' |
||
| 19 | .'\\' . $name; |
||
| 20 | |||
| 21 | if ('RightType' == $name) { |
||
| 22 | $validator = new EmailValidator(); |
||
| 23 | |||
| 24 | $multipleValidations = new MultipleValidationWithAnd([ |
||
| 25 | new RFCValidation(), |
||
| 26 | new DNSCheckValidation() |
||
| 27 | ]); |
||
| 28 | |||
| 29 | return new $validatorClass( |
||
| 30 | $validator, |
||
| 31 | $multipleValidations |
||
| 32 | ); |
||
| 33 | } |
||
| 34 | |||
| 35 | return new $validatorClass(); |
||
| 36 | } |
||
| 37 | } |
||
| 38 |