Skip to content

Commit 0ad288a

Browse files
Merge branch '3.4' into 4.1
* 3.4: [php_cs] disable fopen_flags [DI] fix error in dumped container [CS] Remove unused variables passed to closures [DI] fix dumping setters before their inlined instances [CS] Remove empty comment [CS] Enforces null type hint on last position in phpDocs [CS] Use combined assignment operators when possible Fix a typo in error messages Don't return early as this bypasses the auto exit feature [Console] Add missing null to input values allowed types [PHPUnitBridge] Fix microtime() format bumped Symfony version to 3.4.17 updated VERSION for 3.4.16 updated CHANGELOG for 3.4.16 bumped Symfony version to 2.8.47 update CONTRIBUTORS for 2.8.46 updated VERSION for 2.8.46 updated CHANGELOG for 2.8.46
2 parents d3dbe91 + 513f293 commit 0ad288a

File tree

8 files changed

+29
-33
lines changed

8 files changed

+29
-33
lines changed

Application.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,6 @@ public function run(InputInterface $input = null, OutputInterface $output = null
159159
} else {
160160
$exitCode = 1;
161161
}
162-
163-
return $exitCode;
164162
} finally {
165163
// if the exception handler changed, keep it
166164
// otherwise, unregister $renderException

Command/Command.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ protected function configure()
150150
* execute() method, you set the code to execute by passing
151151
* a Closure to the setCode() method.
152152
*
153-
* @return null|int null or 0 if everything went fine, or an error code
153+
* @return int|null null or 0 if everything went fine, or an error code
154154
*
155155
* @throws LogicException When this abstract method is not implemented
156156
*

Helper/QuestionHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public static function disableStty()
8989
/**
9090
* Asks the question to the user.
9191
*
92-
* @return bool|mixed|null|string
92+
* @return bool|mixed|string|null
9393
*
9494
* @throws RuntimeException In case the fallback is deactivated and the response cannot be hidden
9595
*/

Input/InputArgument.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ class InputArgument
3131
private $description;
3232

3333
/**
34-
* @param string $name The argument name
35-
* @param int $mode The argument mode: self::REQUIRED or self::OPTIONAL
36-
* @param string $description A description text
37-
* @param mixed $default The default value (for self::OPTIONAL mode only)
34+
* @param string $name The argument name
35+
* @param int|null $mode The argument mode: self::REQUIRED or self::OPTIONAL
36+
* @param string $description A description text
37+
* @param string|string[]|null $default The default value (for self::OPTIONAL mode only)
3838
*
3939
* @throws InvalidArgumentException When argument mode is not valid
4040
*/
@@ -86,7 +86,7 @@ public function isArray()
8686
/**
8787
* Sets the default value.
8888
*
89-
* @param string|string[] $default The default value
89+
* @param string|string[]|null $default The default value
9090
*
9191
* @throws LogicException When incorrect default value is given
9292
*/
@@ -110,7 +110,7 @@ public function setDefault($default = null)
110110
/**
111111
* Returns the default value.
112112
*
113-
* @return string|string[] The default value
113+
* @return string|string[]|null The default value
114114
*/
115115
public function getDefault()
116116
{

Input/InputInterface.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public function getArguments();
8585
*
8686
* @param string $name The argument name
8787
*
88-
* @return string|string[] The argument value
88+
* @return string|string[]|null The argument value
8989
*
9090
* @throws InvalidArgumentException When argument given doesn't exist
9191
*/
@@ -94,8 +94,8 @@ public function getArgument($name);
9494
/**
9595
* Sets an argument value by name.
9696
*
97-
* @param string $name The argument name
98-
* @param string|string[] $value The argument value
97+
* @param string $name The argument name
98+
* @param string|string[]|null $value The argument value
9999
*
100100
* @throws InvalidArgumentException When argument given doesn't exist
101101
*/
@@ -122,7 +122,7 @@ public function getOptions();
122122
*
123123
* @param string $name The option name
124124
*
125-
* @return string|string[]|bool The option value
125+
* @return string|string[]|bool|null The option value
126126
*
127127
* @throws InvalidArgumentException When option given doesn't exist
128128
*/
@@ -131,8 +131,8 @@ public function getOption($name);
131131
/**
132132
* Sets an option value by name.
133133
*
134-
* @param string $name The option name
135-
* @param string|string[]|bool $value The option value
134+
* @param string $name The option name
135+
* @param string|string[]|bool|null $value The option value
136136
*
137137
* @throws InvalidArgumentException When option given doesn't exist
138138
*/

Input/InputOption.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ class InputOption
3333
private $description;
3434

3535
/**
36-
* @param string $name The option name
37-
* @param string|array $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts
38-
* @param int $mode The option mode: One of the VALUE_* constants
39-
* @param string $description A description text
40-
* @param mixed $default The default value (must be null for self::VALUE_NONE)
36+
* @param string $name The option name
37+
* @param string|array $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts
38+
* @param int|null $mode The option mode: One of the VALUE_* constants
39+
* @param string $description A description text
40+
* @param string|string[]|bool|null $default The default value (must be null for self::VALUE_NONE)
4141
*
4242
* @throws InvalidArgumentException If option mode is invalid or incompatible
4343
*/
@@ -149,7 +149,7 @@ public function isArray()
149149
/**
150150
* Sets the default value.
151151
*
152-
* @param string|string[]|bool $default The default value
152+
* @param string|string[]|bool|null $default The default value
153153
*
154154
* @throws LogicException When incorrect default value is given
155155
*/
@@ -173,7 +173,7 @@ public function setDefault($default = null)
173173
/**
174174
* Returns the default value.
175175
*
176-
* @return string|string[]|bool The default value
176+
* @return string|string[]|bool|null The default value
177177
*/
178178
public function getDefault()
179179
{

Question/Question.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public function setHiddenFallback($fallback)
117117
/**
118118
* Gets values for the autocompleter.
119119
*
120-
* @return null|iterable
120+
* @return iterable|null
121121
*/
122122
public function getAutocompleterValues()
123123
{
@@ -127,7 +127,7 @@ public function getAutocompleterValues()
127127
/**
128128
* Sets values for the autocompleter.
129129
*
130-
* @param null|iterable $values
130+
* @param iterable|null $values
131131
*
132132
* @return $this
133133
*
@@ -156,7 +156,7 @@ public function setAutocompleterValues($values)
156156
/**
157157
* Sets a validator for the question.
158158
*
159-
* @param null|callable $validator
159+
* @param callable|null $validator
160160
*
161161
* @return $this
162162
*/
@@ -170,7 +170,7 @@ public function setValidator(callable $validator = null)
170170
/**
171171
* Gets the validator for the question.
172172
*
173-
* @return null|callable
173+
* @return callable|null
174174
*/
175175
public function getValidator()
176176
{
@@ -182,7 +182,7 @@ public function getValidator()
182182
*
183183
* Null means an unlimited number of attempts.
184184
*
185-
* @param null|int $attempts
185+
* @param int|null $attempts
186186
*
187187
* @return $this
188188
*
@@ -204,7 +204,7 @@ public function setMaxAttempts($attempts)
204204
*
205205
* Null means an unlimited number of attempts.
206206
*
207-
* @return null|int
207+
* @return int|null
208208
*/
209209
public function getMaxAttempts()
210210
{

Tests/ApplicationTest.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -966,8 +966,7 @@ public function testRunDispatchesIntegerExitCode()
966966

967967
// We can assume here that some other test asserts that the event is dispatched at all
968968
$dispatcher = new EventDispatcher();
969-
$self = $this;
970-
$dispatcher->addListener('console.terminate', function (ConsoleTerminateEvent $event) use ($self, &$passedRightValue) {
969+
$dispatcher->addListener('console.terminate', function (ConsoleTerminateEvent $event) use (&$passedRightValue) {
971970
$passedRightValue = (4 === $event->getExitCode());
972971
});
973972

@@ -1006,8 +1005,7 @@ public function testRunDispatchesExitCodeOneForExceptionCodeZero()
10061005

10071006
// We can assume here that some other test asserts that the event is dispatched at all
10081007
$dispatcher = new EventDispatcher();
1009-
$self = $this;
1010-
$dispatcher->addListener('console.terminate', function (ConsoleTerminateEvent $event) use ($self, &$passedRightValue) {
1008+
$dispatcher->addListener('console.terminate', function (ConsoleTerminateEvent $event) use (&$passedRightValue) {
10111009
$passedRightValue = (1 === $event->getExitCode());
10121010
});
10131011

0 commit comments

Comments
 (0)