Skip to content

Commit 513f293

Browse files
Merge branch '2.8' into 3.4
* 2.8: [php_cs] disable fopen_flags [CS] Remove unused variables passed to closures [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 [Console] Add missing null to input values allowed types [PHPUnitBridge] Fix microtime() format 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 c4799c1 + a52dc77 commit 513f293

File tree

8 files changed

+30
-32
lines changed

8 files changed

+30
-32
lines changed

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
@@ -130,7 +130,7 @@ public static function disableStty()
130130
/**
131131
* Asks the question to the user.
132132
*
133-
* @return bool|mixed|null|string
133+
* @return bool|mixed|string|null
134134
*
135135
* @throws RuntimeException In case the fallback is deactivated and the response cannot be hidden
136136
*/

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/InputDefinition.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ public function getSynopsis($short = false)
387387
if (!$argument->isRequired()) {
388388
$element = '['.$element.']';
389389
} elseif ($argument->isArray()) {
390-
$element = $element.' ('.$element.')';
390+
$element .= ' ('.$element.')';
391391
}
392392

393393
if ($argument->isArray()) {

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
@@ -918,8 +918,7 @@ public function testRunDispatchesIntegerExitCode()
918918

919919
// We can assume here that some other test asserts that the event is dispatched at all
920920
$dispatcher = new EventDispatcher();
921-
$self = $this;
922-
$dispatcher->addListener('console.terminate', function (ConsoleTerminateEvent $event) use ($self, &$passedRightValue) {
921+
$dispatcher->addListener('console.terminate', function (ConsoleTerminateEvent $event) use (&$passedRightValue) {
923922
$passedRightValue = (4 === $event->getExitCode());
924923
});
925924

@@ -958,8 +957,7 @@ public function testRunDispatchesExitCodeOneForExceptionCodeZero()
958957

959958
// We can assume here that some other test asserts that the event is dispatched at all
960959
$dispatcher = new EventDispatcher();
961-
$self = $this;
962-
$dispatcher->addListener('console.terminate', function (ConsoleTerminateEvent $event) use ($self, &$passedRightValue) {
960+
$dispatcher->addListener('console.terminate', function (ConsoleTerminateEvent $event) use (&$passedRightValue) {
963961
$passedRightValue = (1 === $event->getExitCode());
964962
});
965963

0 commit comments

Comments
 (0)