Skip to content

Commit 3b7f035

Browse files
committed
minor #12786 [Console] [DialogHelper] Fix PHP Fatal error: Cannot call constructor in DialogHelper.php on line 37 (driskell)
This PR was merged into the 2.7 branch. Discussion ---------- [Console] [DialogHelper] Fix PHP Fatal error: Cannot call constructor in DialogHelper.php on line 37 | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | N/A | License | MIT | Doc PR | N/A Since yesterday our composer builds have been failing due to an error originating from Symfony/console. We've also been seeing duplicated deprecation warnings: ``` PHP Deprecated: \Symfony\Component\Console\Helper\DialogHelper is deprecated since version 2.5 and will be removed in 3.0. Use QuestionHelper instead. in vendor/symfony/console/Symfony/Component/Console/Helper/DialogHelper.php on line 14 PHP Deprecated: DialogHelper is deprecated since version 2.5 and will be removed in 3.0. Use QuestionHelper instead. in vendor/symfony/console/Symfony/Component/Console/Helper/DialogHelper.php on line 35 PHP Fatal error: Cannot call constructor in vendor/symfony/console/Symfony/Component/Console/Helper/DialogHelper.php on line 37 ``` It looks like this was introduced in PR #12737. Then #12759 was raised to change the warning to the header to only print a single warning. But rather than #12759 having #12737 as a parent and reverting it - it's parent is from before #12737 was merged. So there's now a situation of both PR having being merged - one adding deprecation warning to file header, and one adding deprecation to construct() (and also causing fatal error.) This PR fixes the issue by reverting the breaking parent::construct() added by #12737 so essentially only #12759 is active, which adds a single deprecation warning, and does not break the code. NB: This is the test failure for the Console component - test fails since #12737. This patch fixes this and passes all tests for the Console component. ``` $ phpunit src/Symfony/Component/Console PHP Fatal error: Cannot call constructor in src/Symfony/Component/Console/Helper/DialogHelper.php on line 37 ``` Jason Commits ------- ada9a58 Fix PHP Fatal error: Cannot call constructor in symfony/console/Symfony/Component/Console/Helper/DialogHelper.php on line 37
2 parents 9c6b377 + ada9a58 commit 3b7f035

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

src/Symfony/Component/Console/Helper/DialogHelper.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,6 @@ class DialogHelper extends InputAwareHelper
3030
private static $shell;
3131
private static $stty;
3232

33-
public function __construct()
34-
{
35-
trigger_error('DialogHelper is deprecated since version 2.5 and will be removed in 3.0. Use QuestionHelper instead.', E_USER_DEPRECATED);
36-
37-
parent::__construct();
38-
}
3933
/**
4034
* Asks the user to select a value.
4135
*

0 commit comments

Comments
 (0)