Skip to content

Commit

Permalink
[make:command] deprecate passing PhpCompatUtil to the constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
jrushlow committed Feb 7, 2024
1 parent c5be30d commit ab2b061
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
9 changes: 8 additions & 1 deletion src/Maker/MakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,15 @@
*/
final class MakeCommand extends AbstractMaker
{
public function __construct(private PhpCompatUtil $phpCompatUtil)
public function __construct(private ?PhpCompatUtil $phpCompatUtil = null)
{
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),
);
}
}

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 @@ -17,7 +17,6 @@
</service>

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

Expand Down

0 comments on commit ab2b061

Please sign in to comment.