Skip to content

Commit 7d6e719

Browse files
derrabusnicolas-grekas
authored andcommitted
Add missing return types to interfaces
1 parent 766d8f0 commit 7d6e719

10 files changed

+73
-0
lines changed

Descriptor/DescriptorInterface.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,8 @@
2020
*/
2121
interface DescriptorInterface
2222
{
23+
/**
24+
* @return void
25+
*/
2326
public function describe(OutputInterface $output, object $object, array $options = []);
2427
}

Formatter/OutputFormatterInterface.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ interface OutputFormatterInterface
2020
{
2121
/**
2222
* Sets the decorated flag.
23+
*
24+
* @return void
2325
*/
2426
public function setDecorated(bool $decorated);
2527

@@ -30,6 +32,8 @@ public function isDecorated(): bool;
3032

3133
/**
3234
* Sets a new style.
35+
*
36+
* @return void
3337
*/
3438
public function setStyle(string $name, OutputFormatterStyleInterface $style);
3539

Formatter/OutputFormatterStyleInterface.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,26 +20,36 @@ interface OutputFormatterStyleInterface
2020
{
2121
/**
2222
* Sets style foreground color.
23+
*
24+
* @return void
2325
*/
2426
public function setForeground(?string $color);
2527

2628
/**
2729
* Sets style background color.
30+
*
31+
* @return void
2832
*/
2933
public function setBackground(?string $color);
3034

3135
/**
3236
* Sets some specific style option.
37+
*
38+
* @return void
3339
*/
3440
public function setOption(string $option);
3541

3642
/**
3743
* Unsets some specific style option.
44+
*
45+
* @return void
3846
*/
3947
public function unsetOption(string $option);
4048

4149
/**
4250
* Sets multiple style options at once.
51+
*
52+
* @return void
4353
*/
4454
public function setOptions(array $options);
4555

Helper/HelperInterface.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ interface HelperInterface
2020
{
2121
/**
2222
* Sets the helper set associated with this helper.
23+
*
24+
* @return void
2325
*/
2426
public function setHelperSet(?HelperSet $helperSet);
2527

Input/InputAwareInterface.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ interface InputAwareInterface
2121
{
2222
/**
2323
* Sets the Console Input.
24+
*
25+
* @return void
2426
*/
2527
public function setInput(InputInterface $input);
2628
}

Input/InputInterface.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,17 @@ public function getParameterOption(string|array $values, string|bool|int|float|a
6161
/**
6262
* Binds the current Input instance with the given arguments and options.
6363
*
64+
* @return void
65+
*
6466
* @throws RuntimeException
6567
*/
6668
public function bind(InputDefinition $definition);
6769

6870
/**
6971
* Validates the input.
7072
*
73+
* @return void
74+
*
7175
* @throws RuntimeException When not enough arguments are given
7276
*/
7377
public function validate();
@@ -91,6 +95,8 @@ public function getArgument(string $name);
9195
/**
9296
* Sets an argument value by name.
9397
*
98+
* @return void
99+
*
94100
* @throws InvalidArgumentException When argument given doesn't exist
95101
*/
96102
public function setArgument(string $name, mixed $value);
@@ -119,6 +125,8 @@ public function getOption(string $name);
119125
/**
120126
* Sets an option value by name.
121127
*
128+
* @return void
129+
*
122130
* @throws InvalidArgumentException When option given doesn't exist
123131
*/
124132
public function setOption(string $name, mixed $value);
@@ -135,6 +143,8 @@ public function isInteractive(): bool;
135143

136144
/**
137145
* Sets the input interactivity.
146+
*
147+
* @return void
138148
*/
139149
public function setInteractive(bool $interactive);
140150
}

Input/StreamableInputInterface.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ interface StreamableInputInterface extends InputInterface
2525
* This is mainly useful for testing purpose.
2626
*
2727
* @param resource $stream The input stream
28+
*
29+
* @return void
2830
*/
2931
public function setStream($stream);
3032

Output/ConsoleOutputInterface.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ interface ConsoleOutputInterface extends OutputInterface
2424
*/
2525
public function getErrorOutput(): OutputInterface;
2626

27+
/**
28+
* @return void
29+
*/
2730
public function setErrorOutput(OutputInterface $error);
2831

2932
public function section(): ConsoleSectionOutput;

Output/OutputInterface.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ interface OutputInterface
3636
* @param bool $newline Whether to add a newline
3737
* @param int $options A bitmask of options (one of the OUTPUT or VERBOSITY constants),
3838
* 0 is considered the same as self::OUTPUT_NORMAL | self::VERBOSITY_NORMAL
39+
*
40+
* @return void
3941
*/
4042
public function write(string|iterable $messages, bool $newline = false, int $options = 0);
4143

@@ -44,11 +46,15 @@ public function write(string|iterable $messages, bool $newline = false, int $opt
4446
*
4547
* @param int $options A bitmask of options (one of the OUTPUT or VERBOSITY constants),
4648
* 0 is considered the same as self::OUTPUT_NORMAL | self::VERBOSITY_NORMAL
49+
*
50+
* @return void
4751
*/
4852
public function writeln(string|iterable $messages, int $options = 0);
4953

5054
/**
5155
* Sets the verbosity of the output.
56+
*
57+
* @return void
5258
*/
5359
public function setVerbosity(int $level);
5460

@@ -87,6 +93,9 @@ public function setDecorated(bool $decorated);
8793
*/
8894
public function isDecorated(): bool;
8995

96+
/**
97+
* @return void
98+
*/
9099
public function setFormatter(OutputFormatterInterface $formatter);
91100

92101
/**

Style/StyleInterface.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,51 +20,71 @@ interface StyleInterface
2020
{
2121
/**
2222
* Formats a command title.
23+
*
24+
* @return void
2325
*/
2426
public function title(string $message);
2527

2628
/**
2729
* Formats a section title.
30+
*
31+
* @return void
2832
*/
2933
public function section(string $message);
3034

3135
/**
3236
* Formats a list.
37+
*
38+
* @return void
3339
*/
3440
public function listing(array $elements);
3541

3642
/**
3743
* Formats informational text.
44+
*
45+
* @return void
3846
*/
3947
public function text(string|array $message);
4048

4149
/**
4250
* Formats a success result bar.
51+
*
52+
* @return void
4353
*/
4454
public function success(string|array $message);
4555

4656
/**
4757
* Formats an error result bar.
58+
*
59+
* @return void
4860
*/
4961
public function error(string|array $message);
5062

5163
/**
5264
* Formats an warning result bar.
65+
*
66+
* @return void
5367
*/
5468
public function warning(string|array $message);
5569

5670
/**
5771
* Formats a note admonition.
72+
*
73+
* @return void
5874
*/
5975
public function note(string|array $message);
6076

6177
/**
6278
* Formats a caution admonition.
79+
*
80+
* @return void
6381
*/
6482
public function caution(string|array $message);
6583

6684
/**
6785
* Formats a table.
86+
*
87+
* @return void
6888
*/
6989
public function table(array $headers, array $rows);
7090

@@ -90,21 +110,29 @@ public function choice(string $question, array $choices, mixed $default = null):
90110

91111
/**
92112
* Add newline(s).
113+
*
114+
* @return void
93115
*/
94116
public function newLine(int $count = 1);
95117

96118
/**
97119
* Starts the progress output.
120+
*
121+
* @return void
98122
*/
99123
public function progressStart(int $max = 0);
100124

101125
/**
102126
* Advances the progress output X steps.
127+
*
128+
* @return void
103129
*/
104130
public function progressAdvance(int $step = 1);
105131

106132
/**
107133
* Finishes the progress output.
134+
*
135+
* @return void
108136
*/
109137
public function progressFinish();
110138
}

0 commit comments

Comments
 (0)