. */ 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: 905 $ $Date: 2010-10-05 18:28:03 +0200 (Tue, 05 Oct 2010) $ * @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(); } }