Overview

Classes

  • Horde_Constraint_AlwaysFalse
  • Horde_Constraint_AlwaysTrue
  • Horde_Constraint_And
  • Horde_Constraint_Coupler
  • Horde_Constraint_IsEqual
  • Horde_Constraint_IsInstanceOf
  • Horde_Constraint_Not
  • Horde_Constraint_Null
  • Horde_Constraint_Or
  • Horde_Constraint_PregMatch

Interfaces

  • Horde_Constraint
  • Overview
  • Class
  • Tree
 1: <?php
 2: /**
 3:  * Matches against a PCRE regex
 4:  *
 5:  * Based on PHPUnit_Framework_Constraint_PCREMatch
 6:  *
 7:  * @author James Pepin <james@jamespepin.com>
 8:  */
 9: class Horde_Constraint_PregMatch implements Horde_Constraint
10: {
11:     private $_regex;
12: 
13:     public function __construct($regex)
14:     {
15:         $this->_regex = $regex;
16:     }
17: 
18:     public function evaluate($value)
19:     {
20:         return preg_match($this->_regex, $value) > 0;
21:     }
22: }
23: 
API documentation generated by ApiGen