minor #41987 [Console] SymfonyStyle - add string type to confirm() $question by co… (TomasVotruba)
This PR was merged into the 5.2 branch. Discussion ---------- [Console] SymfonyStyle - add string type to confirm() $question by co… PR retargeted from Symfony 5.4: https://github.com/symfony/symfony/pull/41983 Inspired by & follow up to https://github.com/symfony/symfony/pull/41946 by `@nicolas`-grekas <br> This type is always string, see contract5010ebdad9/src/Symfony/Component/Console/Style/StyleInterface.php (L102)
Also `ConfirmationQuestion` requires `string` strict type bellow Probably forgotten during adding types everywhere in https://github.com/symfony/symfony/pull/32318 | Q | A | ------------- | --- | Branch? | 5.2 | Bug fix? | no | New feature? | no | Deprecations? | no | License | MIT Commits -------d0c337d524
[Console] SymfonyStyle - add string type to confirm() $question by contract
This commit is contained in:
commit
257666378c
@ -288,7 +288,7 @@ class SymfonyStyle extends OutputStyle
|
|||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function confirm($question, $default = true)
|
public function confirm(string $question, bool $default = true)
|
||||||
{
|
{
|
||||||
return $this->askQuestion(new ConfirmationQuestion($question, $default));
|
return $this->askQuestion(new ConfirmationQuestion($question, $default));
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user