1: <?php
2:
3: /**
4: * Pry Framework
5: *
6: * LICENSE
7: *
8: * This source file is subject to the new BSD license that is bundled
9: * with this package in the file LICENSE.txt.
10: *
11: */
12:
13: namespace Pry\Validate\Validator;
14:
15: use Pry\Validate\ValidateAbstract;
16:
17: /**
18: * Validateur d'adresse email.
19: * @category Pry
20: * @package Validate
21: * @subpackage Validate_Validator
22: * @version 1.0.0
23: * @author Olivier ROGER <oroger.fr>
24: *
25: */
26: class Email extends ValidateAbstract
27: {
28:
29: /**
30: * Constructeur
31: * @access public
32: */
33: public function __construct()
34: {
35: $this->errorMsg = "n'est pas un email valide";
36: }
37:
38: /**
39: * Validation
40: *
41: * @param string $string Elément à valider
42: * @return boolean
43: */
44: public function isValid($string)
45: {
46: $string = $this->cleanString((string) $string);
47: return \Pry\Util\Strings::isMail($string);
48: }
49:
50: }
51:
52: ?>