-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathInput.php
More file actions
100 lines (88 loc) · 2.35 KB
/
Copy pathInput.php
File metadata and controls
100 lines (88 loc) · 2.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<?php
declare(strict_types=1);
namespace Snicco\Component\BetterWPCLI\Input;
/**
* @psalm-immutable
*/
interface Input
{
/**
* Retrieves an argument by its name or returns the value passed to $default
* if no argument with the name was passed in the command-line.
*
* @psalm-return (
* $default is null
* ? string|null
* : string
* )
*/
public function getArgument(string $name, ?string $default = null): ?string;
/**
* Retrieves a repeating argument by its name or returns the value passed to
* $default if no argument with the name was passed in the command-line.
*
* @param string[]|null $default
*
* @return string[]|null
*
* @psalm-return (
* $default is null
* ? string[]|null
* : string[]
* )
*/
public function getRepeatingArgument(string $name, ?array $default = null): ?array;
/**
* Retrieves an option by its name or returns the value passed to $default
* if no option with the name was passed in the command-line.
*
* @psalm-return (
* $default is null
* ? string|null
* : string
* )
*/
public function getOption(string $name, ?string $default = null): ?string;
/**
* Retrieves a flag by its name or returns the value passed to $default if
* no flag with the name was passed in the command-line.
*
* @psalm-return (
* $default is null
* ? bool|null
* : bool
* )
*/
public function getFlag(string $name, ?bool $default = null): ?bool;
/**
* Returns all arguments keyed by the argument name.
*
* @return array<string,string>
*/
public function getArguments(): array;
/**
* Returns all repeating arguments keyed by the argument name.
*
* @return array<string,string[]>
*/
public function getRepeatingArguments(): array;
/**
* Returns all options keyed by the option name.
*
* @return array<string,string>
*/
public function getOptions(): array;
/**
* Returns all flags keyed by the flag name.
*
* @return array<string,bool>
*/
public function getFlags(): array;
public function isInteractive(): bool;
/**
* Returns the input stream - presumably STDIN.
*
* @return resource
*/
public function getStream();
}