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.
|
|
|
|
*/
|
2022-01-08 00:28:55 +00:00
|
|
|
namespace RectorPrefix20220108\Symfony\Component\Console\Input;
|
2021-05-10 00:23:30 +00:00
|
|
|
|
2022-01-08 00:28:55 +00:00
|
|
|
use RectorPrefix20220108\Symfony\Component\Console\Exception\InvalidArgumentException;
|
|
|
|
use RectorPrefix20220108\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).
|
|
|
|
*/
|
2021-12-09 13:05:29 +00:00
|
|
|
public function getFirstArgument() : ?string;
|
2021-05-10 00:23:30 +00:00
|
|
|
/**
|
|
|
|
* 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
|
|
|
|
*/
|
2021-12-10 10:22:23 +00:00
|
|
|
public function hasParameterOption($values, bool $onlyParams = \false) : bool;
|
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
|
|
|
*
|
2021-11-30 07:57:42 +00:00
|
|
|
* @return mixed
|
2021-05-10 00:23:30 +00:00
|
|
|
*/
|
2021-12-10 10:22:23 +00:00
|
|
|
public function getParameterOption($values, $default = \false, bool $onlyParams = \false);
|
2021-05-10 00:23:30 +00:00
|
|
|
/**
|
|
|
|
* Binds the current Input instance with the given arguments and options.
|
|
|
|
*
|
|
|
|
* @throws RuntimeException
|
|
|
|
*/
|
2022-01-08 00:28:55 +00:00
|
|
|
public function bind(\RectorPrefix20220108\Symfony\Component\Console\Input\InputDefinition $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
|
|
|
*/
|
2021-12-09 13:05:29 +00:00
|
|
|
public function getArguments() : array;
|
2021-05-10 00:23:30 +00:00
|
|
|
/**
|
|
|
|
* 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-12-10 10:22:23 +00:00
|
|
|
public function getArgument(string $name);
|
2021-05-10 00:23:30 +00:00
|
|
|
/**
|
|
|
|
* Sets an argument value by name.
|
|
|
|
*
|
|
|
|
* @throws InvalidArgumentException When argument given doesn't exist
|
2021-12-09 13:05:29 +00:00
|
|
|
* @param mixed $value
|
2021-05-10 00:23:30 +00:00
|
|
|
*/
|
2021-12-10 10:22:23 +00:00
|
|
|
public function setArgument(string $name, $value);
|
2021-05-10 00:23:30 +00:00
|
|
|
/**
|
|
|
|
* Returns true if an InputArgument object exists by name or position.
|
|
|
|
*/
|
2021-12-10 10:22:23 +00:00
|
|
|
public function hasArgument(string $name) : bool;
|
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
|
|
|
*/
|
2021-12-09 13:05:29 +00:00
|
|
|
public function getOptions() : array;
|
2021-05-10 00:23:30 +00:00
|
|
|
/**
|
|
|
|
* 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-12-10 10:22:23 +00:00
|
|
|
public function getOption(string $name);
|
2021-05-10 00:23:30 +00:00
|
|
|
/**
|
|
|
|
* Sets an option value by name.
|
|
|
|
*
|
|
|
|
* @throws InvalidArgumentException When option given doesn't exist
|
2021-12-09 13:05:29 +00:00
|
|
|
* @param mixed $value
|
2021-05-10 00:23:30 +00:00
|
|
|
*/
|
2021-12-10 10:22:23 +00:00
|
|
|
public function setOption(string $name, $value);
|
2021-05-10 00:23:30 +00:00
|
|
|
/**
|
|
|
|
* Returns true if an InputOption object exists by name.
|
|
|
|
*/
|
2021-12-10 10:22:23 +00:00
|
|
|
public function hasOption(string $name) : bool;
|
2021-05-10 00:23:30 +00:00
|
|
|
/**
|
|
|
|
* Is this input means interactive?
|
|
|
|
*/
|
2021-12-09 13:05:29 +00:00
|
|
|
public function isInteractive() : bool;
|
2021-05-10 00:23:30 +00:00
|
|
|
/**
|
|
|
|
* Sets the input interactivity.
|
|
|
|
*/
|
2021-12-10 10:22:23 +00:00
|
|
|
public function setInteractive(bool $interactive);
|
2021-05-10 00:23:30 +00:00
|
|
|
}
|