. */ require_once 'phing/tasks/system/condition/ConditionBase.php'; /** * condition. * * Evaluates to true if the single condition nested into it is false * and vice versa. * * @author Andreas Aderhold * @copyright © 2001,2002 THYRELL. All rights reserved * @version $Revision: 1.6 $ $Date: 2006-04-28 16:49:47 +0200 (Fri, 28 Apr 2006) $ * @access public * @package phing.tasks.system.condition */ class NotCondition extends ConditionBase implements Condition { function evaluate() { if ($this->countConditions() > 1) { throw new BuildException("You must not nest more than one condition into "); } if ($this->countConditions() < 1) { throw new BuildException("You must nest a condition into "); } $conds = $this->getIterator(); return !$conds->current()->evaluate(); } }