Skip to content

Commit

Permalink
feature #1443 [make:controller] deprecate passing PhpCompatUtil to th…
Browse files Browse the repository at this point in the history
…e constructor
  • Loading branch information
jrushlow authored Feb 7, 2024
1 parent e22c38c commit 73580f9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
10 changes: 6 additions & 4 deletions src/Maker/MakeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,13 @@ final class MakeController extends AbstractMaker
{
public function __construct(private ?PhpCompatUtil $phpCompatUtil = null)
{
if (null === $phpCompatUtil) {
@trigger_error(sprintf('Passing a "%s" instance is mandatory since version 1.42.0', PhpCompatUtil::class), \E_USER_DEPRECATED);
if (null !== $phpCompatUtil) {
@trigger_deprecation(
'symfony/maker-bundle',
'1.55.0',
sprintf('Initializing MakeCommand while providing an instance of "%s" is deprecated. The $phpCompatUtil param will be removed in a future version.', PhpCompatUtil::class)
);
}

$this->phpCompatUtil = $phpCompatUtil;
}

public static function getCommandName(): string
Expand Down
1 change: 0 additions & 1 deletion src/Resources/config/makers.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
</service>

<service id="maker.maker.make_controller" class="Symfony\Bundle\MakerBundle\Maker\MakeController">
<argument type="service" id="maker.php_compat_util" />
<tag name="maker.command" />
</service>

Expand Down

0 comments on commit 73580f9

Please sign in to comment.