1: <?php
2:
3: /**
4: * Jyxo PHP Library
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: * It is also available through the world-wide-web at this URL:
11: * https://github.com/jyxo/php/blob/master/license.txt
12: */
13:
14: /**
15: * Base abstract validator class.
16: *
17: * @category Jyxo
18: * @package Jyxo_Input
19: * @subpackage Validator
20: * @copyright Copyright (c) 2005-2011 Jyxo, s.r.o.
21: * @license https://github.com/jyxo/php/blob/master/license.txt
22: * @author Jaroslav HanslĂk
23: */
24: abstract class Jyxo_Input_Validator_AbstractValidator implements Jyxo_Input_ValidatorInterface
25: {
26: /**
27: * Constructor.
28: */
29: public function __construct()
30: {}
31:
32: /**
33: * Validates a value.
34: *
35: * @param mixed $value Input value
36: * @return boolean
37: */
38: public static function validate($value)
39: {
40: $class = new ReflectionClass(get_called_class());
41: $validator = $class->newInstanceArgs(array_slice(func_get_args(), 1));
42: return $validator->isValid($value);
43: }
44: }
45: