. */ namespace Doctrine\Common\Cli; /** * CLI Configuration class * * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @link www.doctrine-project.org * @since 2.0 * @version $Revision$ * @author Benjamin Eberlei * @author Guilherme Blanco * @author Jonathan Wage * @author Roman Borschel */ class Configuration { /** * @var array Configuration attributes */ private $_attributes = array(); /** * Defines a new configuration attribute * * @param string $name Attribute name * @param mixed $value Attribute value * * @return Configuration This object instance */ public function setAttribute($name, $value = null) { $this->_attributes[$name] = $value; if ($value === null) { unset($this->_attributes[$name]); } return $this; } /** * Retrieves a configuration attribute * * @param string $name Attribute name * * @return mixed Attribute value */ public function getAttribute($name) { return isset($this->_attributes[$name]) ? $this->_attributes[$name] : null; } /** * Checks if configuration attribute is defined * * @param string $name Attribute name * * @return boolean TRUE if attribute exists, FALSE otherwise */ public function hasAttribute($name) { return isset($this->_attributes[$name]); } }