Source for file Element.php
Documentation is available at Element.php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
* This file is part of the PEAR Console_CommandLine package.
* LICENSE: This source file is subject to the MIT license that is available
* through the world-wide-web at the following URI:
* http://opensource.org/licenses/mit-license.php
* @package Console_CommandLine
* @author David JEAN LOUIS <izimobil@gmail.com>
* @copyright 2007 David JEAN LOUIS
* @license http://opensource.org/licenses/mit-license.php MIT License
* @link http://pear.php.net/package/Console_CommandLine
* @since File available since release 0.1.0
* Class that represent a command line element (an option, or an argument).
* @package Console_CommandLine
* @author David JEAN LOUIS <izimobil@gmail.com>
* @copyright 2007 David JEAN LOUIS
* @license http://opensource.org/licenses/mit-license.php MIT License
* @version Release: 1.2.0
* @link http://pear.php.net/package/Console_CommandLine
* @since Class available since release 0.1.0
* @var string $name Element name
* The name of variable displayed in the usage message, if no set it
* defaults to the "name" property.
* @var string $help_name Element "help" variable name
* The element description.
* @var string $description Element description
* The default value of the element if not provided on the command line.
* @var mixed $default Default value of the option.
* Custom errors messages for this element
* This array is of the form:
* $messageName => $messageText,
* $messageName => $messageText,
* If specified, these messages override the messages provided by the
* default message provider. For example:
* 'ARGUMENT_REQUIRED' => 'The argument foo is required.',
* @see Console_CommandLine_MessageProvider_Default
* @param string $name The name of the element
* @param array $params An optional array of parameters
public function __construct($name = null , $params = array ())
foreach ($params as $attr => $value) {
* Returns the string representation of the element.
* @return string The string representation of the element
* @todo use __toString() instead
* Validates the element instance and set it's default values.
* @throws Console_CommandLine_Exception
// if no help_name passed, default to name
Documentation generated on Mon, 11 Mar 2019 15:51:32 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|