[Console] tagged the guaranteed BC API
This commit is contained in:
parent
ff3c66753f
commit
9206af1773
@ -41,6 +41,8 @@ use Symfony\Component\Console\Helper\DialogHelper;
|
||||
* $app->run();
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
class Application
|
||||
{
|
||||
@ -60,6 +62,8 @@ class Application
|
||||
*
|
||||
* @param string $name The name of the application
|
||||
* @param string $version The version of the application
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function __construct($name = 'UNKNOWN', $version = 'UNKNOWN')
|
||||
{
|
||||
@ -98,6 +102,8 @@ class Application
|
||||
* @return integer 0 if everything went fine, or an error code
|
||||
*
|
||||
* @throws \Exception When doRun returns Exception
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function run(InputInterface $input = null, OutputInterface $output = null)
|
||||
{
|
||||
@ -194,6 +200,8 @@ class Application
|
||||
* Set a helper set to be used with the command.
|
||||
*
|
||||
* @param HelperSet $helperSet The helper set
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function setHelperSet(HelperSet $helperSet)
|
||||
{
|
||||
@ -204,6 +212,8 @@ class Application
|
||||
* Get the helper set associated with the command.
|
||||
*
|
||||
* @return HelperSet The HelperSet instance associated with this command
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function getHelperSet()
|
||||
{
|
||||
@ -250,6 +260,8 @@ class Application
|
||||
* Sets whether to catch exceptions or not during commands execution.
|
||||
*
|
||||
* @param Boolean $boolean Whether to catch exceptions or not during commands execution
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function setCatchExceptions($boolean)
|
||||
{
|
||||
@ -260,6 +272,8 @@ class Application
|
||||
* Sets whether to automatically exit after a command execution or not.
|
||||
*
|
||||
* @param Boolean $boolean Whether to automatically exit after a command execution or not
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function setAutoExit($boolean)
|
||||
{
|
||||
@ -270,6 +284,8 @@ class Application
|
||||
* Gets the name of the application.
|
||||
*
|
||||
* @return string The application name
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
@ -280,6 +296,8 @@ class Application
|
||||
* Sets the application name.
|
||||
*
|
||||
* @param string $name The application name
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function setName($name)
|
||||
{
|
||||
@ -290,6 +308,8 @@ class Application
|
||||
* Gets the application version.
|
||||
*
|
||||
* @return string The application version
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function getVersion()
|
||||
{
|
||||
@ -300,6 +320,8 @@ class Application
|
||||
* Sets the application version.
|
||||
*
|
||||
* @param string $version The application version
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function setVersion($version)
|
||||
{
|
||||
@ -310,6 +332,8 @@ class Application
|
||||
* Returns the long version of the application.
|
||||
*
|
||||
* @return string The long application version
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function getLongVersion()
|
||||
{
|
||||
@ -326,6 +350,8 @@ class Application
|
||||
* @param string $name The command name
|
||||
*
|
||||
* @return Command The newly created command
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function register($name)
|
||||
{
|
||||
@ -336,6 +362,8 @@ class Application
|
||||
* Adds an array of command objects.
|
||||
*
|
||||
* @param Command[] $commands An array of commands
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function addCommands(array $commands)
|
||||
{
|
||||
@ -352,6 +380,8 @@ class Application
|
||||
* @param Command $command A Command object
|
||||
*
|
||||
* @return Command The registered command
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function add(Command $command)
|
||||
{
|
||||
@ -374,6 +404,8 @@ class Application
|
||||
* @return Command A Command object
|
||||
*
|
||||
* @throws \InvalidArgumentException When command name given does not exist
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function get($name)
|
||||
{
|
||||
@ -401,6 +433,8 @@ class Application
|
||||
* @param string $name The command name or alias
|
||||
*
|
||||
* @return Boolean true if the command exists, false otherwise
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function has($name)
|
||||
{
|
||||
@ -461,6 +495,8 @@ class Application
|
||||
* @return Command A Command instance
|
||||
*
|
||||
* @throws \InvalidArgumentException When command name is incorrect or ambiguous
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function find($name)
|
||||
{
|
||||
@ -513,6 +549,8 @@ class Application
|
||||
* @param string $namespace A namespace name
|
||||
*
|
||||
* @return array An array of Command instances
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function all($namespace = null)
|
||||
{
|
||||
|
@ -22,6 +22,8 @@ use Symfony\Component\Console\Application;
|
||||
* Base class for all commands.
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
class Command
|
||||
{
|
||||
@ -43,6 +45,8 @@ class Command
|
||||
* @param string $name The name of the command
|
||||
*
|
||||
* @throws \LogicException When the command name is empty
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function __construct($name = null)
|
||||
{
|
||||
@ -66,6 +70,8 @@ class Command
|
||||
* Sets the application instance for this command.
|
||||
*
|
||||
* @param Application $application An Application instance
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function setApplication(Application $application = null)
|
||||
{
|
||||
@ -76,6 +82,8 @@ class Command
|
||||
* Gets the application instance for this command.
|
||||
*
|
||||
* @return Application An Application instance
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function getApplication()
|
||||
{
|
||||
@ -145,6 +153,8 @@ class Command
|
||||
*
|
||||
* @see setCode()
|
||||
* @see execute()
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function run(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
@ -189,6 +199,8 @@ class Command
|
||||
* @return Command The current instance
|
||||
*
|
||||
* @see execute()
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function setCode(\Closure $code)
|
||||
{
|
||||
@ -222,6 +234,8 @@ class Command
|
||||
* @param array|Definition $definition An array of argument and option instances or a definition instance
|
||||
*
|
||||
* @return Command The current instance
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function setDefinition($definition)
|
||||
{
|
||||
@ -240,6 +254,8 @@ class Command
|
||||
* Gets the InputDefinition attached to this Command.
|
||||
*
|
||||
* @return InputDefinition An InputDefinition instance
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function getDefinition()
|
||||
{
|
||||
@ -255,6 +271,8 @@ class Command
|
||||
* @param mixed $default The default value (for InputArgument::OPTIONAL mode only)
|
||||
*
|
||||
* @return Command The current instance
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function addArgument($name, $mode = null, $description = '', $default = null)
|
||||
{
|
||||
@ -273,6 +291,8 @@ class Command
|
||||
* @param mixed $default The default value (must be null for InputOption::VALUE_REQUIRED or self::VALUE_NONE)
|
||||
*
|
||||
* @return Command The current instance
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function addOption($name, $shortcut = null, $mode = null, $description = '', $default = null)
|
||||
{
|
||||
@ -294,6 +314,8 @@ class Command
|
||||
* @return Command The current instance
|
||||
*
|
||||
* @throws \InvalidArgumentException When command name given is empty
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function setName($name)
|
||||
{
|
||||
@ -318,6 +340,8 @@ class Command
|
||||
* Returns the command namespace.
|
||||
*
|
||||
* @return string The command namespace
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function getNamespace()
|
||||
{
|
||||
@ -328,6 +352,8 @@ class Command
|
||||
* Returns the command name
|
||||
*
|
||||
* @return string The command name
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
@ -338,6 +364,8 @@ class Command
|
||||
* Returns the fully qualified command name.
|
||||
*
|
||||
* @return string The fully qualified command name
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function getFullName()
|
||||
{
|
||||
@ -350,6 +378,8 @@ class Command
|
||||
* @param string $description The description for the command
|
||||
*
|
||||
* @return Command The current instance
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function setDescription($description)
|
||||
{
|
||||
@ -362,6 +392,8 @@ class Command
|
||||
* Returns the description for the command.
|
||||
*
|
||||
* @return string The description for the command
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function getDescription()
|
||||
{
|
||||
@ -374,6 +406,8 @@ class Command
|
||||
* @param string $help The help for the command
|
||||
*
|
||||
* @return Command The current instance
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function setHelp($help)
|
||||
{
|
||||
@ -386,6 +420,8 @@ class Command
|
||||
* Returns the help for the command.
|
||||
*
|
||||
* @return string The help for the command
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function getHelp()
|
||||
{
|
||||
@ -420,6 +456,8 @@ class Command
|
||||
* @param array $aliases An array of aliases for the command
|
||||
*
|
||||
* @return Command The current instance
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function setAliases($aliases)
|
||||
{
|
||||
@ -432,6 +470,8 @@ class Command
|
||||
* Returns the aliases for the command.
|
||||
*
|
||||
* @return array An array of aliases for the command
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function getAliases()
|
||||
{
|
||||
@ -460,6 +500,8 @@ class Command
|
||||
* @return mixed The helper value
|
||||
*
|
||||
* @throws \InvalidArgumentException if the helper is not defined
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function getHelper($name)
|
||||
{
|
||||
|
@ -15,6 +15,8 @@ namespace Symfony\Component\Console\Formatter;
|
||||
* Formatter class for console output.
|
||||
*
|
||||
* @author Konstantin Kudryashov <ever.zet@gmail.com>
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
class OutputFormatter implements OutputFormatterInterface
|
||||
{
|
||||
@ -26,6 +28,8 @@ class OutputFormatter implements OutputFormatterInterface
|
||||
*
|
||||
* @param boolean $decorated Whether this formatter should actually decorate strings
|
||||
* @param array $styles Array of "name => FormatterStyle" instance
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function __construct($decorated = null, array $styles = array())
|
||||
{
|
||||
@ -45,6 +49,8 @@ class OutputFormatter implements OutputFormatterInterface
|
||||
* Sets the decorated flag.
|
||||
*
|
||||
* @param Boolean $decorated Whether to decorated the messages or not
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function setDecorated($decorated)
|
||||
{
|
||||
@ -55,6 +61,8 @@ class OutputFormatter implements OutputFormatterInterface
|
||||
* Gets the decorated flag.
|
||||
*
|
||||
* @return Boolean true if the output will decorate messages, false otherwise
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function isDecorated()
|
||||
{
|
||||
@ -66,6 +74,8 @@ class OutputFormatter implements OutputFormatterInterface
|
||||
*
|
||||
* @param string $name The style name
|
||||
* @param OutputFormatterStyleInterface $options The style instance
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function setStyle($name, OutputFormatterStyleInterface $style)
|
||||
{
|
||||
@ -78,6 +88,8 @@ class OutputFormatter implements OutputFormatterInterface
|
||||
* @param string $name
|
||||
*
|
||||
* @return boolean
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function hasStyle($name)
|
||||
{
|
||||
@ -90,6 +102,8 @@ class OutputFormatter implements OutputFormatterInterface
|
||||
* @param string $name
|
||||
*
|
||||
* @return OutputFormatterStyleInterface
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function getStyle($name)
|
||||
{
|
||||
@ -106,6 +120,8 @@ class OutputFormatter implements OutputFormatterInterface
|
||||
* @param string $message The message to style
|
||||
*
|
||||
* @return string The styled message
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function format($message)
|
||||
{
|
||||
|
@ -15,6 +15,8 @@ namespace Symfony\Component\Console\Formatter;
|
||||
* Formatter interface for console output.
|
||||
*
|
||||
* @author Konstantin Kudryashov <ever.zet@gmail.com>
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
interface OutputFormatterInterface
|
||||
{
|
||||
@ -22,6 +24,8 @@ interface OutputFormatterInterface
|
||||
* Sets the decorated flag.
|
||||
*
|
||||
* @param Boolean $decorated Whether to decorated the messages or not
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
function setDecorated($decorated);
|
||||
|
||||
@ -29,6 +33,8 @@ interface OutputFormatterInterface
|
||||
* Gets the decorated flag.
|
||||
*
|
||||
* @return Boolean true if the output will decorate messages, false otherwise
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
function isDecorated();
|
||||
|
||||
@ -37,6 +43,8 @@ interface OutputFormatterInterface
|
||||
*
|
||||
* @param string $name The style name
|
||||
* @param OutputFormatterStyleInterface $options The style instance
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
function setStyle($name, OutputFormatterStyleInterface $style);
|
||||
|
||||
@ -46,6 +54,8 @@ interface OutputFormatterInterface
|
||||
* @param string $name
|
||||
*
|
||||
* @return boolean
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
function hasStyle($name);
|
||||
|
||||
@ -55,6 +65,8 @@ interface OutputFormatterInterface
|
||||
* @param string $name
|
||||
*
|
||||
* @return OutputFormatterStyleInterface
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
function getStyle($name);
|
||||
|
||||
@ -64,6 +76,8 @@ interface OutputFormatterInterface
|
||||
* @param string $message The message to style
|
||||
*
|
||||
* @return string The styled message
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
function format($message);
|
||||
}
|
||||
|
@ -15,6 +15,8 @@ namespace Symfony\Component\Console\Formatter;
|
||||
* Formatter style class for defining styles.
|
||||
*
|
||||
* @author Konstantin Kudryashov <ever.zet@gmail.com>
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
class OutputFormatterStyle implements OutputFormatterStyleInterface
|
||||
{
|
||||
@ -56,6 +58,8 @@ class OutputFormatterStyle implements OutputFormatterStyleInterface
|
||||
* @param string $foreground style foreground color name
|
||||
* @param string $background style background color name
|
||||
* @param array $options style options
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function __construct($foreground = null, $background = null, array $options = array())
|
||||
{
|
||||
@ -74,6 +78,8 @@ class OutputFormatterStyle implements OutputFormatterStyleInterface
|
||||
* Sets style foreground color.
|
||||
*
|
||||
* @param string $color color name
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function setForeground($color = null)
|
||||
{
|
||||
@ -98,6 +104,8 @@ class OutputFormatterStyle implements OutputFormatterStyleInterface
|
||||
* Sets style background color.
|
||||
*
|
||||
* @param string $color color name
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function setBackground($color = null)
|
||||
{
|
||||
@ -122,6 +130,8 @@ class OutputFormatterStyle implements OutputFormatterStyleInterface
|
||||
* Sets some specific style option.
|
||||
*
|
||||
* @param string $option option name
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function setOption($option)
|
||||
{
|
||||
|
@ -15,6 +15,8 @@ namespace Symfony\Component\Console\Formatter;
|
||||
* Formatter style interface for defining styles.
|
||||
*
|
||||
* @author Konstantin Kudryashov <ever.zet@gmail.com>
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
interface OutputFormatterStyleInterface
|
||||
{
|
||||
@ -22,6 +24,8 @@ interface OutputFormatterStyleInterface
|
||||
* Sets style foreground color.
|
||||
*
|
||||
* @param string $color color name
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
function setForeground($color = null);
|
||||
|
||||
@ -29,6 +33,8 @@ interface OutputFormatterStyleInterface
|
||||
* Sets style background color.
|
||||
*
|
||||
* @param string $color color name
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
function setBackground($color = null);
|
||||
|
||||
@ -36,6 +42,8 @@ interface OutputFormatterStyleInterface
|
||||
* Sets some specific style option.
|
||||
*
|
||||
* @param string $option option name
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
function setOption($option);
|
||||
|
||||
|
@ -15,6 +15,8 @@ namespace Symfony\Component\Console\Helper;
|
||||
* HelperInterface is the interface all helpers must implement.
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
interface HelperInterface
|
||||
{
|
||||
@ -22,6 +24,8 @@ interface HelperInterface
|
||||
* Sets the helper set associated with this helper.
|
||||
*
|
||||
* @param HelperSet $helperSet A HelperSet instance
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
function setHelperSet(HelperSet $helperSet = null);
|
||||
|
||||
@ -29,6 +33,8 @@ interface HelperInterface
|
||||
* Gets the helper set associated with this helper.
|
||||
*
|
||||
* @return HelperSet A HelperSet instance
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
function getHelperSet();
|
||||
|
||||
@ -36,6 +42,8 @@ interface HelperInterface
|
||||
* Returns the canonical name of this helper.
|
||||
*
|
||||
* @return string The canonical name
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
function getName();
|
||||
}
|
||||
|
@ -35,6 +35,8 @@ namespace Symfony\Component\Console\Input;
|
||||
*
|
||||
* @see http://www.gnu.org/software/libc/manual/html_node/Argument-Syntax.html
|
||||
* @see http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap12.html#tag_12_02
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
class ArgvInput extends Input
|
||||
{
|
||||
@ -46,6 +48,8 @@ class ArgvInput extends Input
|
||||
*
|
||||
* @param array $argv An array of parameters from the CLI (in the argv format)
|
||||
* @param InputDefinition $definition A InputDefinition instance
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function __construct(array $argv = null, InputDefinition $definition = null)
|
||||
{
|
||||
|
@ -19,6 +19,8 @@ namespace Symfony\Component\Console\Input;
|
||||
* $input = new ArrayInput(array('name' => 'foo', '--bar' => 'foobar'));
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
class ArrayInput extends Input
|
||||
{
|
||||
@ -29,6 +31,8 @@ class ArrayInput extends Input
|
||||
*
|
||||
* @param array $param An array of parameters
|
||||
* @param InputDefinition $definition A InputDefinition instance
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function __construct(array $parameters, InputDefinition $definition = null)
|
||||
{
|
||||
|
@ -15,6 +15,8 @@ namespace Symfony\Component\Console\Input;
|
||||
* Represents a command line argument.
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
class InputArgument
|
||||
{
|
||||
@ -36,6 +38,8 @@ class InputArgument
|
||||
* @param mixed $default The default value (for self::OPTIONAL mode only)
|
||||
*
|
||||
* @throws \InvalidArgumentException When argument mode is not valid
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function __construct($name, $mode = null, $description = '', $default = null)
|
||||
{
|
||||
|
@ -22,6 +22,8 @@ namespace Symfony\Component\Console\Input;
|
||||
* ));
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
class InputDefinition
|
||||
{
|
||||
@ -36,6 +38,8 @@ class InputDefinition
|
||||
* Constructor.
|
||||
*
|
||||
* @param array $definition An array of InputArgument and InputOption instance
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function __construct(array $definition = array())
|
||||
{
|
||||
@ -46,6 +50,8 @@ class InputDefinition
|
||||
* Sets the definition of the input.
|
||||
*
|
||||
* @param array $definition The definition array
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function setDefinition(array $definition)
|
||||
{
|
||||
@ -67,6 +73,8 @@ class InputDefinition
|
||||
* Sets the InputArgument objects.
|
||||
*
|
||||
* @param array $arguments An array of InputArgument objects
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function setArguments($arguments = array())
|
||||
{
|
||||
@ -81,6 +89,8 @@ class InputDefinition
|
||||
* Add an array of InputArgument objects.
|
||||
*
|
||||
* @param InputArgument[] $arguments An array of InputArgument objects
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function addArguments($arguments = array())
|
||||
{
|
||||
@ -97,6 +107,8 @@ class InputDefinition
|
||||
* @param InputArgument $argument An InputArgument object
|
||||
*
|
||||
* @throws \LogicException When incorrect argument is given
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function addArgument(InputArgument $argument)
|
||||
{
|
||||
@ -133,6 +145,8 @@ class InputDefinition
|
||||
* @return InputArgument An InputArgument object
|
||||
*
|
||||
* @throws \InvalidArgumentException When argument given doesn't exist
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function getArgument($name)
|
||||
{
|
||||
@ -151,6 +165,8 @@ class InputDefinition
|
||||
* @param string|integer $name The InputArgument name or position
|
||||
*
|
||||
* @return Boolean true if the InputArgument object exists, false otherwise
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function hasArgument($name)
|
||||
{
|
||||
@ -163,6 +179,8 @@ class InputDefinition
|
||||
* Gets the array of InputArgument objects.
|
||||
*
|
||||
* @return array An array of InputArgument objects
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function getArguments()
|
||||
{
|
||||
@ -208,6 +226,8 @@ class InputDefinition
|
||||
* Sets the InputOption objects.
|
||||
*
|
||||
* @param array $options An array of InputOption objects
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function setOptions($options = array())
|
||||
{
|
||||
@ -220,6 +240,8 @@ class InputDefinition
|
||||
* Add an array of InputOption objects.
|
||||
*
|
||||
* @param InputOption[] $options An array of InputOption objects
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function addOptions($options = array())
|
||||
{
|
||||
@ -234,6 +256,8 @@ class InputDefinition
|
||||
* @param InputOption $option An InputOption object
|
||||
*
|
||||
* @throws \LogicException When option given already exist
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function addOption(InputOption $option)
|
||||
{
|
||||
@ -255,6 +279,8 @@ class InputDefinition
|
||||
* @param string $name The InputOption name
|
||||
*
|
||||
* @return InputOption A InputOption object
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function getOption($name)
|
||||
{
|
||||
@ -271,6 +297,8 @@ class InputDefinition
|
||||
* @param string $name The InputOption name
|
||||
*
|
||||
* @return Boolean true if the InputOption object exists, false otherwise
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function hasOption($name)
|
||||
{
|
||||
@ -281,6 +309,8 @@ class InputDefinition
|
||||
* Gets the array of InputOption objects.
|
||||
*
|
||||
* @return array An array of InputOption objects
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function getOptions()
|
||||
{
|
||||
|
@ -15,6 +15,8 @@ namespace Symfony\Component\Console\Input;
|
||||
* Represents a command line option.
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
class InputOption
|
||||
{
|
||||
@ -39,6 +41,8 @@ class InputOption
|
||||
* @param mixed $default The default value (must be null for self::VALUE_REQUIRED or self::VALUE_NONE)
|
||||
*
|
||||
* @throws \InvalidArgumentException If option mode is invalid or incompatible
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function __construct($name, $shortcut = null, $mode = null, $description = '', $default = null)
|
||||
{
|
||||
|
@ -19,6 +19,8 @@ namespace Symfony\Component\Console\Input;
|
||||
* $input = new StringInput('foo --bar="foobar"');
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
class StringInput extends ArgvInput
|
||||
{
|
||||
@ -30,6 +32,8 @@ class StringInput extends ArgvInput
|
||||
*
|
||||
* @param string $input An array of parameters from the CLI (in the argv format)
|
||||
* @param InputDefinition $definition A InputDefinition instance
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function __construct($input, InputDefinition $definition = null)
|
||||
{
|
||||
|
@ -25,6 +25,8 @@ use Symfony\Component\Console\Formatter\OutputFormatter;
|
||||
* $output = new StreamOutput(fopen('php://stdout', 'w'));
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
class ConsoleOutput extends StreamOutput
|
||||
{
|
||||
@ -34,6 +36,8 @@ class ConsoleOutput extends StreamOutput
|
||||
* @param integer $verbosity The verbosity level (self::VERBOSITY_QUIET, self::VERBOSITY_NORMAL, self::VERBOSITY_VERBOSE)
|
||||
* @param Boolean $decorated Whether to decorate messages or not (null for auto-guessing)
|
||||
* @param OutputFormatter $formatter Output formatter instance
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function __construct($verbosity = self::VERBOSITY_NORMAL, $decorated = null, OutputFormatter $formatter = null)
|
||||
{
|
||||
|
@ -17,6 +17,8 @@ namespace Symfony\Component\Console\Output;
|
||||
* $output = new NullOutput();
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
class NullOutput extends Output
|
||||
{
|
||||
|
@ -24,6 +24,8 @@ use Symfony\Component\Console\Formatter\OutputFormatter;
|
||||
* * quiet: -q (no output)
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
abstract class Output implements OutputInterface
|
||||
{
|
||||
@ -44,6 +46,8 @@ abstract class Output implements OutputInterface
|
||||
* @param integer $verbosity The verbosity level (self::VERBOSITY_QUIET, self::VERBOSITY_NORMAL, self::VERBOSITY_VERBOSE)
|
||||
* @param Boolean $decorated Whether to decorate messages or not (null for auto-guessing)
|
||||
* @param OutputFormatterInterface $formatter Output formatter instance
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function __construct($verbosity = self::VERBOSITY_NORMAL, $decorated = null, OutputFormatterInterface $formatter = null)
|
||||
{
|
||||
@ -60,6 +64,8 @@ abstract class Output implements OutputInterface
|
||||
* Sets output formatter.
|
||||
*
|
||||
* @param OutputFormatterInterface $formatter
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function setFormatter(OutputFormatterInterface $formatter)
|
||||
{
|
||||
@ -70,6 +76,8 @@ abstract class Output implements OutputInterface
|
||||
* Returns current output formatter instance.
|
||||
*
|
||||
* @return OutputFormatterInterface
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function getFormatter()
|
||||
{
|
||||
@ -80,6 +88,8 @@ abstract class Output implements OutputInterface
|
||||
* Sets the decorated flag.
|
||||
*
|
||||
* @param Boolean $decorated Whether to decorated the messages or not
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function setDecorated($decorated)
|
||||
{
|
||||
@ -90,6 +100,8 @@ abstract class Output implements OutputInterface
|
||||
* Gets the decorated flag.
|
||||
*
|
||||
* @return Boolean true if the output will decorate messages, false otherwise
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function isDecorated()
|
||||
{
|
||||
@ -100,6 +112,8 @@ abstract class Output implements OutputInterface
|
||||
* Sets the verbosity of the output.
|
||||
*
|
||||
* @param integer $level The level of verbosity
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function setVerbosity($level)
|
||||
{
|
||||
@ -110,6 +124,8 @@ abstract class Output implements OutputInterface
|
||||
* Gets the current verbosity of the output.
|
||||
*
|
||||
* @return integer The current level of verbosity
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function getVerbosity()
|
||||
{
|
||||
@ -121,6 +137,8 @@ abstract class Output implements OutputInterface
|
||||
*
|
||||
* @param string|array $messages The message as an array of lines of a single string
|
||||
* @param integer $type The type of output
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function writeln($messages, $type = 0)
|
||||
{
|
||||
@ -135,6 +153,8 @@ abstract class Output implements OutputInterface
|
||||
* @param integer $type The type of output
|
||||
*
|
||||
* @throws \InvalidArgumentException When unknown output type is given
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function write($messages, $newline = false, $type = 0)
|
||||
{
|
||||
|
@ -17,6 +17,8 @@ use Symfony\Component\Console\Formatter\OutputFormatterInterface;
|
||||
* OutputInterface is the interface implemented by all Output classes.
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
interface OutputInterface
|
||||
{
|
||||
@ -28,6 +30,8 @@ interface OutputInterface
|
||||
* @param integer $type The type of output
|
||||
*
|
||||
* @throws \InvalidArgumentException When unknown output type is given
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
function write($messages, $newline = false, $type = 0);
|
||||
|
||||
@ -36,6 +40,8 @@ interface OutputInterface
|
||||
*
|
||||
* @param string|array $messages The message as an array of lines of a single string
|
||||
* @param integer $type The type of output
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
function writeln($messages, $type = 0);
|
||||
|
||||
@ -43,20 +49,42 @@ interface OutputInterface
|
||||
* Sets the verbosity of the output.
|
||||
*
|
||||
* @param integer $level The level of verbosity
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
function setVerbosity($level);
|
||||
|
||||
/**
|
||||
* Gets the current verbosity of the output.
|
||||
*
|
||||
* @return integer The current level of verbosity
|
||||
*/
|
||||
function getVerbosity();
|
||||
|
||||
/**
|
||||
* Sets the decorated flag.
|
||||
*
|
||||
* @param Boolean $decorated Whether to decorated the messages or not
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
function setDecorated($decorated);
|
||||
|
||||
/**
|
||||
* Gets the decorated flag.
|
||||
*
|
||||
* @return Boolean true if the output will decorate messages, false otherwise
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
function isDecorated();
|
||||
|
||||
/**
|
||||
* Sets output formatter.
|
||||
*
|
||||
* @param OutputFormatterInterface $formatter
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
function setFormatter(OutputFormatterInterface $formatter);
|
||||
|
||||
@ -64,6 +92,8 @@ interface OutputInterface
|
||||
* Returns current output formatter instance.
|
||||
*
|
||||
* @return OutputFormatterInterface
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
function getFormatter();
|
||||
}
|
||||
|
@ -25,6 +25,8 @@ use Symfony\Component\Console\Formatter\OutputFormatter;
|
||||
* $output = new StreamOutput(fopen('/path/to/output.log', 'a', false));
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
class StreamOutput extends Output
|
||||
{
|
||||
@ -39,6 +41,8 @@ class StreamOutput extends Output
|
||||
* @param OutputFormatter $formatter Output formatter instance
|
||||
*
|
||||
* @throws \InvalidArgumentException When first argument is not a real stream
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function __construct($stream, $verbosity = self::VERBOSITY_NORMAL, $decorated = null, OutputFormatter $formatter = null)
|
||||
{
|
||||
|
Reference in New Issue
Block a user