ArgvInput.php
1 year ago
ArrayInput.php
1 year ago
Input.php
1 year ago
InputArgument.php
2 years ago
InputAwareInterface.php
2 years ago
InputDefinition.php
1 year ago
InputInterface.php
1 year ago
InputOption.php
1 year ago
StreamableInputInterface.php
2 years ago
StringInput.php
2 years ago
InputInterface.php
136 lines
| 1 | <?php |
| 2 | |
| 3 | /* |
| 4 | * This file is part of the Symfony package. |
| 5 | * |
| 6 | * (c) Fabien Potencier <fabien@symfony.com> |
| 7 | * |
| 8 | * For the full copyright and license information, please view the LICENSE |
| 9 | * file that was distributed with this source code. |
| 10 | */ |
| 11 | namespace Matomo\Dependencies\Symfony\Component\Console\Input; |
| 12 | |
| 13 | use Matomo\Dependencies\Symfony\Component\Console\Exception\InvalidArgumentException; |
| 14 | use Matomo\Dependencies\Symfony\Component\Console\Exception\RuntimeException; |
| 15 | /** |
| 16 | * InputInterface is the interface implemented by all input classes. |
| 17 | * |
| 18 | * @author Fabien Potencier <fabien@symfony.com> |
| 19 | */ |
| 20 | interface InputInterface |
| 21 | { |
| 22 | /** |
| 23 | * Returns the first argument from the raw parameters (not parsed). |
| 24 | * |
| 25 | * @return string|null |
| 26 | */ |
| 27 | public function getFirstArgument(); |
| 28 | /** |
| 29 | * Returns true if the raw parameters (not parsed) contain a value. |
| 30 | * |
| 31 | * This method is to be used to introspect the input parameters |
| 32 | * before they have been validated. It must be used carefully. |
| 33 | * Does not necessarily return the correct result for short options |
| 34 | * when multiple flags are combined in the same option. |
| 35 | * |
| 36 | * @param string|array $values The values to look for in the raw parameters (can be an array) |
| 37 | * @param bool $onlyParams Only check real parameters, skip those following an end of options (--) signal |
| 38 | * |
| 39 | * @return bool |
| 40 | */ |
| 41 | public function hasParameterOption($values, bool $onlyParams = \false); |
| 42 | /** |
| 43 | * Returns the value of a raw option (not parsed). |
| 44 | * |
| 45 | * This method is to be used to introspect the input parameters |
| 46 | * before they have been validated. It must be used carefully. |
| 47 | * Does not necessarily return the correct result for short options |
| 48 | * when multiple flags are combined in the same option. |
| 49 | * |
| 50 | * @param string|array $values The value(s) to look for in the raw parameters (can be an array) |
| 51 | * @param string|bool|int|float|array|null $default The default value to return if no result is found |
| 52 | * @param bool $onlyParams Only check real parameters, skip those following an end of options (--) signal |
| 53 | * |
| 54 | * @return mixed |
| 55 | */ |
| 56 | public function getParameterOption($values, $default = \false, bool $onlyParams = \false); |
| 57 | /** |
| 58 | * Binds the current Input instance with the given arguments and options. |
| 59 | * |
| 60 | * @throws RuntimeException |
| 61 | */ |
| 62 | public function bind(InputDefinition $definition); |
| 63 | /** |
| 64 | * Validates the input. |
| 65 | * |
| 66 | * @throws RuntimeException When not enough arguments are given |
| 67 | */ |
| 68 | public function validate(); |
| 69 | /** |
| 70 | * Returns all the given arguments merged with the default values. |
| 71 | * |
| 72 | * @return array<string|bool|int|float|array|null> |
| 73 | */ |
| 74 | public function getArguments(); |
| 75 | /** |
| 76 | * Returns the argument value for a given argument name. |
| 77 | * |
| 78 | * @return mixed |
| 79 | * |
| 80 | * @throws InvalidArgumentException When argument given doesn't exist |
| 81 | */ |
| 82 | public function getArgument(string $name); |
| 83 | /** |
| 84 | * Sets an argument value by name. |
| 85 | * |
| 86 | * @param mixed $value The argument value |
| 87 | * |
| 88 | * @throws InvalidArgumentException When argument given doesn't exist |
| 89 | */ |
| 90 | public function setArgument(string $name, $value); |
| 91 | /** |
| 92 | * Returns true if an InputArgument object exists by name or position. |
| 93 | * |
| 94 | * @return bool |
| 95 | */ |
| 96 | public function hasArgument(string $name); |
| 97 | /** |
| 98 | * Returns all the given options merged with the default values. |
| 99 | * |
| 100 | * @return array<string|bool|int|float|array|null> |
| 101 | */ |
| 102 | public function getOptions(); |
| 103 | /** |
| 104 | * Returns the option value for a given option name. |
| 105 | * |
| 106 | * @return mixed |
| 107 | * |
| 108 | * @throws InvalidArgumentException When option given doesn't exist |
| 109 | */ |
| 110 | public function getOption(string $name); |
| 111 | /** |
| 112 | * Sets an option value by name. |
| 113 | * |
| 114 | * @param mixed $value The option value |
| 115 | * |
| 116 | * @throws InvalidArgumentException When option given doesn't exist |
| 117 | */ |
| 118 | public function setOption(string $name, $value); |
| 119 | /** |
| 120 | * Returns true if an InputOption object exists by name. |
| 121 | * |
| 122 | * @return bool |
| 123 | */ |
| 124 | public function hasOption(string $name); |
| 125 | /** |
| 126 | * Is this input means interactive? |
| 127 | * |
| 128 | * @return bool |
| 129 | */ |
| 130 | public function isInteractive(); |
| 131 | /** |
| 132 | * Sets the input interactivity. |
| 133 | */ |
| 134 | public function setInteractive(bool $interactive); |
| 135 | } |
| 136 |