2021-05-10 00:23:30 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This file is part of the Symfony package.
|
|
|
|
*
|
|
|
|
* (c) Fabien Potencier <fabien@symfony.com>
|
|
|
|
*
|
|
|
|
* For the full copyright and license information, please view the LICENSE
|
|
|
|
* file that was distributed with this source code.
|
|
|
|
*/
|
2021-09-05 00:27:40 +00:00
|
|
|
namespace RectorPrefix20210905\Symfony\Component\Console\Input;
|
2021-05-10 00:23:30 +00:00
|
|
|
|
2021-09-05 00:27:40 +00:00
|
|
|
use RectorPrefix20210905\Symfony\Component\Console\Exception\InvalidArgumentException;
|
|
|
|
use RectorPrefix20210905\Symfony\Component\Console\Exception\RuntimeException;
|
2021-05-10 00:23:30 +00:00
|
|
|
/**
|
|
|
|
* InputInterface is the interface implemented by all input classes.
|
|
|
|
*
|
|
|
|
* @author Fabien Potencier <fabien@symfony.com>
|
|
|
|
*/
|
|
|
|
interface InputInterface
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Returns the first argument from the raw parameters (not parsed).
|
|
|
|
*
|
|
|
|
* @return string|null The value of the first argument or null otherwise
|
|
|
|
*/
|
|
|
|
public function getFirstArgument();
|
|
|
|
/**
|
|
|
|
* Returns true if the raw parameters (not parsed) contain a value.
|
|
|
|
*
|
|
|
|
* This method is to be used to introspect the input parameters
|
|
|
|
* before they have been validated. It must be used carefully.
|
|
|
|
* Does not necessarily return the correct result for short options
|
|
|
|
* when multiple flags are combined in the same option.
|
|
|
|
*
|
|
|
|
* @param string|array $values The values to look for in the raw parameters (can be an array)
|
|
|
|
* @param bool $onlyParams Only check real parameters, skip those following an end of options (--) signal
|
|
|
|
*
|
|
|
|
* @return bool true if the value is contained in the raw parameters
|
|
|
|
*/
|
2021-07-05 22:50:18 +00:00
|
|
|
public function hasParameterOption($values, $onlyParams = \false);
|
2021-05-10 00:23:30 +00:00
|
|
|
/**
|
|
|
|
* Returns the value of a raw option (not parsed).
|
|
|
|
*
|
|
|
|
* This method is to be used to introspect the input parameters
|
|
|
|
* before they have been validated. It must be used carefully.
|
|
|
|
* Does not necessarily return the correct result for short options
|
|
|
|
* when multiple flags are combined in the same option.
|
|
|
|
*
|
2021-07-05 15:06:41 +00:00
|
|
|
* @param string|array $values The value(s) to look for in the raw parameters (can be an array)
|
|
|
|
* @param string|bool|int|float|array|null $default The default value to return if no result is found
|
|
|
|
* @param bool $onlyParams Only check real parameters, skip those following an end of options (--) signal
|
2021-05-10 00:23:30 +00:00
|
|
|
*
|
|
|
|
* @return mixed The option value
|
|
|
|
*/
|
2021-07-05 22:50:18 +00:00
|
|
|
public function getParameterOption($values, $default = \false, $onlyParams = \false);
|
2021-05-10 00:23:30 +00:00
|
|
|
/**
|
|
|
|
* Binds the current Input instance with the given arguments and options.
|
|
|
|
*
|
|
|
|
* @throws RuntimeException
|
2021-08-23 00:20:32 +00:00
|
|
|
* @param \Symfony\Component\Console\Input\InputDefinition $definition
|
2021-05-10 00:23:30 +00:00
|
|
|
*/
|
2021-07-05 22:50:18 +00:00
|
|
|
public function bind($definition);
|
2021-05-10 00:23:30 +00:00
|
|
|
/**
|
|
|
|
* Validates the input.
|
|
|
|
*
|
|
|
|
* @throws RuntimeException When not enough arguments are given
|
|
|
|
*/
|
|
|
|
public function validate();
|
|
|
|
/**
|
|
|
|
* Returns all the given arguments merged with the default values.
|
|
|
|
*
|
2021-07-05 15:06:41 +00:00
|
|
|
* @return array<string|bool|int|float|array|null>
|
2021-05-10 00:23:30 +00:00
|
|
|
*/
|
|
|
|
public function getArguments();
|
|
|
|
/**
|
|
|
|
* Returns the argument value for a given argument name.
|
|
|
|
*
|
2021-07-04 22:54:28 +00:00
|
|
|
* @return mixed
|
2021-05-10 00:23:30 +00:00
|
|
|
*
|
|
|
|
* @throws InvalidArgumentException When argument given doesn't exist
|
2021-07-05 22:50:18 +00:00
|
|
|
* @param string $name
|
2021-05-10 00:23:30 +00:00
|
|
|
*/
|
2021-07-05 22:50:18 +00:00
|
|
|
public function getArgument($name);
|
2021-05-10 00:23:30 +00:00
|
|
|
/**
|
|
|
|
* Sets an argument value by name.
|
|
|
|
*
|
2021-07-04 22:54:28 +00:00
|
|
|
* @param mixed $value The argument value
|
2021-05-10 00:23:30 +00:00
|
|
|
*
|
|
|
|
* @throws InvalidArgumentException When argument given doesn't exist
|
2021-07-05 22:50:18 +00:00
|
|
|
* @param string $name
|
2021-05-10 00:23:30 +00:00
|
|
|
*/
|
2021-07-05 22:50:18 +00:00
|
|
|
public function setArgument($name, $value);
|
2021-05-10 00:23:30 +00:00
|
|
|
/**
|
|
|
|
* Returns true if an InputArgument object exists by name or position.
|
|
|
|
*
|
|
|
|
* @return bool true if the InputArgument object exists, false otherwise
|
2021-07-05 22:50:18 +00:00
|
|
|
* @param string $name
|
2021-05-10 00:23:30 +00:00
|
|
|
*/
|
2021-07-05 22:50:18 +00:00
|
|
|
public function hasArgument($name);
|
2021-05-10 00:23:30 +00:00
|
|
|
/**
|
|
|
|
* Returns all the given options merged with the default values.
|
|
|
|
*
|
2021-07-05 15:06:41 +00:00
|
|
|
* @return array<string|bool|int|float|array|null>
|
2021-05-10 00:23:30 +00:00
|
|
|
*/
|
|
|
|
public function getOptions();
|
|
|
|
/**
|
|
|
|
* Returns the option value for a given option name.
|
|
|
|
*
|
2021-07-04 22:54:28 +00:00
|
|
|
* @return mixed
|
2021-05-10 00:23:30 +00:00
|
|
|
*
|
|
|
|
* @throws InvalidArgumentException When option given doesn't exist
|
2021-07-05 22:50:18 +00:00
|
|
|
* @param string $name
|
2021-05-10 00:23:30 +00:00
|
|
|
*/
|
2021-07-05 22:50:18 +00:00
|
|
|
public function getOption($name);
|
2021-05-10 00:23:30 +00:00
|
|
|
/**
|
|
|
|
* Sets an option value by name.
|
|
|
|
*
|
2021-07-04 22:54:28 +00:00
|
|
|
* @param mixed $value The option value
|
2021-05-10 00:23:30 +00:00
|
|
|
*
|
|
|
|
* @throws InvalidArgumentException When option given doesn't exist
|
2021-07-05 22:50:18 +00:00
|
|
|
* @param string $name
|
2021-05-10 00:23:30 +00:00
|
|
|
*/
|
2021-07-05 22:50:18 +00:00
|
|
|
public function setOption($name, $value);
|
2021-05-10 00:23:30 +00:00
|
|
|
/**
|
|
|
|
* Returns true if an InputOption object exists by name.
|
|
|
|
*
|
|
|
|
* @return bool true if the InputOption object exists, false otherwise
|
2021-07-05 22:50:18 +00:00
|
|
|
* @param string $name
|
2021-05-10 00:23:30 +00:00
|
|
|
*/
|
2021-07-05 22:50:18 +00:00
|
|
|
public function hasOption($name);
|
2021-05-10 00:23:30 +00:00
|
|
|
/**
|
|
|
|
* Is this input means interactive?
|
|
|
|
*
|
|
|
|
* @return bool
|
|
|
|
*/
|
|
|
|
public function isInteractive();
|
|
|
|
/**
|
|
|
|
* Sets the input interactivity.
|
2021-07-05 22:50:18 +00:00
|
|
|
* @param bool $interactive
|
2021-05-10 00:23:30 +00:00
|
|
|
*/
|
2021-07-05 22:50:18 +00:00
|
|
|
public function setInteractive($interactive);
|
2021-05-10 00:23:30 +00:00
|
|
|
}
|