Security update for Core, with self-updated composer
[yaffs-website] / vendor / symfony / console / Input / InputInterface.php
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
12 namespace Symfony\Component\Console\Input;
13
14 use Symfony\Component\Console\Exception\InvalidArgumentException;
15 use Symfony\Component\Console\Exception\RuntimeException;
16
17 /**
18  * InputInterface is the interface implemented by all input classes.
19  *
20  * @author Fabien Potencier <fabien@symfony.com>
21  */
22 interface InputInterface
23 {
24     /**
25      * Returns the first argument from the raw parameters (not parsed).
26      *
27      * @return string The value of the first argument or null otherwise
28      */
29     public function getFirstArgument();
30
31     /**
32      * Returns true if the raw parameters (not parsed) contain a value.
33      *
34      * This method is to be used to introspect the input parameters
35      * before they have been validated. It must be used carefully.
36      *
37      * @param string|array $values     The values to look for in the raw parameters (can be an array)
38      * @param bool         $onlyParams Only check real parameters, skip those following an end of options (--) signal
39      *
40      * @return bool true if the value is contained in the raw parameters
41      */
42     public function hasParameterOption($values, $onlyParams = false);
43
44     /**
45      * Returns the value of a raw option (not parsed).
46      *
47      * This method is to be used to introspect the input parameters
48      * before they have been validated. It must be used carefully.
49      *
50      * @param string|array $values     The value(s) to look for in the raw parameters (can be an array)
51      * @param mixed        $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 The option value
55      */
56     public function getParameterOption($values, $default = false, $onlyParams = false);
57
58     /**
59      * Binds the current Input instance with the given arguments and options.
60      *
61      * @param InputDefinition $definition A InputDefinition instance
62      */
63     public function bind(InputDefinition $definition);
64
65     /**
66      * Validates the input.
67      *
68      * @throws RuntimeException When not enough arguments are given
69      */
70     public function validate();
71
72     /**
73      * Returns all the given arguments merged with the default values.
74      *
75      * @return array
76      */
77     public function getArguments();
78
79     /**
80      * Returns the argument value for a given argument name.
81      *
82      * @param string $name The argument name
83      *
84      * @return mixed The argument value
85      *
86      * @throws InvalidArgumentException When argument given doesn't exist
87      */
88     public function getArgument($name);
89
90     /**
91      * Sets an argument value by name.
92      *
93      * @param string $name  The argument name
94      * @param string $value The argument value
95      *
96      * @throws InvalidArgumentException When argument given doesn't exist
97      */
98     public function setArgument($name, $value);
99
100     /**
101      * Returns true if an InputArgument object exists by name or position.
102      *
103      * @param string|int $name The InputArgument name or position
104      *
105      * @return bool true if the InputArgument object exists, false otherwise
106      */
107     public function hasArgument($name);
108
109     /**
110      * Returns all the given options merged with the default values.
111      *
112      * @return array
113      */
114     public function getOptions();
115
116     /**
117      * Returns the option value for a given option name.
118      *
119      * @param string $name The option name
120      *
121      * @return mixed The option value
122      *
123      * @throws InvalidArgumentException When option given doesn't exist
124      */
125     public function getOption($name);
126
127     /**
128      * Sets an option value by name.
129      *
130      * @param string      $name  The option name
131      * @param string|bool $value The option value
132      *
133      * @throws InvalidArgumentException When option given doesn't exist
134      */
135     public function setOption($name, $value);
136
137     /**
138      * Returns true if an InputOption object exists by name.
139      *
140      * @param string $name The InputOption name
141      *
142      * @return bool true if the InputOption object exists, false otherwise
143      */
144     public function hasOption($name);
145
146     /**
147      * Is this input means interactive?
148      *
149      * @return bool
150      */
151     public function isInteractive();
152
153     /**
154      * Sets the input interactivity.
155      *
156      * @param bool $interactive If the input should be interactive
157      */
158     public function setInteractive($interactive);
159 }