Skip to content

Commit 30086cc

Browse files
minor symfony#25644 [Console] Improve phpdoc on StyleInterface::ask() (ro0NL)
This PR was merged into the 2.7 branch. Discussion ---------- [Console] Improve phpdoc on StyleInterface::ask() | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #... <!-- #-prefixed issue number(s), if any --> | License | MIT | Doc PR | symfony/symfony-docs#... <!--highly recommended for new features--> In a CLI command i keep asking an optional question until i get an answer. So interactively it's a required question. It looks like.. ```php do { $value = $io->ask('Value', null, function ($value) { return $value; }); } while (null === $value); ``` Which works nice.. but SA is complaining about ``` Strict comparison using === between null and string will always evaluate to false. ``` This should fix it. The mixed API goes back to https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Console/Helper/QuestionHelper.php#L38 Commits ------- 499d04f [Console] Improve phpdoc on StyleInterface::ask()
2 parents 95c6193 + 499d04f commit 30086cc

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/Symfony/Component/Console/Style/StyleInterface.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public function table(array $headers, array $rows);
9191
* @param string|null $default
9292
* @param callable|null $validator
9393
*
94-
* @return string
94+
* @return mixed
9595
*/
9696
public function ask($question, $default = null, $validator = null);
9797

@@ -101,7 +101,7 @@ public function ask($question, $default = null, $validator = null);
101101
* @param string $question
102102
* @param callable|null $validator
103103
*
104-
* @return string
104+
* @return mixed
105105
*/
106106
public function askHidden($question, $validator = null);
107107

@@ -122,7 +122,7 @@ public function confirm($question, $default = true);
122122
* @param array $choices
123123
* @param string|int|null $default
124124
*
125-
* @return string
125+
* @return mixed
126126
*/
127127
public function choice($question, array $choices, $default = null);
128128

src/Symfony/Component/Console/Style/SymfonyStyle.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ public function createProgressBar($max = 0)
314314
}
315315

316316
/**
317-
* @return string
317+
* @return mixed
318318
*/
319319
public function askQuestion(Question $question)
320320
{

0 commit comments

Comments
 (0)