/usr/share/php/Horde/Constraint/Coupler.php is in php-horde-constraint 2.0.1-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | <?php
/**
* Interface for grouped (compound, coupled) constraints.
*
* @author James Pepin <james@jamespepin.com>
*/
abstract class Horde_Constraint_Coupler implements Horde_Constraint
{
protected $_constraints = array();
public function __construct()
{
$constraints = func_get_args();
foreach ($constraints as $c) {
if (! $c instanceof Horde_Constraint) {
throw new IllegalArgumentException("$c does not implement Horde_Constraint");
}
$this->addConstraint($c);
}
}
public function addConstraint(Horde_Constraint $constraint)
{
$kind = get_class($this);
if ($constraint instanceof $kind) {
foreach ($constraint->getConstraints() as $c) {
$this->addConstraint($c);
}
} else {
$this->_constraints[] = $constraint;
}
return $this;
}
public function getConstraints()
{
return $this->_constraints;
}
}
|