From 547fb16a6b709807d906faeeb5b8b293180a5a45 Mon Sep 17 00:00:00 2001 From: Vinicius Dias Date: Fri, 15 Aug 2025 23:21:21 -0300 Subject: [PATCH] Using correct method to add command to CLI application --- bin/transformers | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/transformers b/bin/transformers index 29cf8dc..8e904fb 100755 --- a/bin/transformers +++ b/bin/transformers @@ -12,7 +12,9 @@ $application = new Application(); try { $application->setName('Transformers PHP CLI'); - $application->addCommand(new Codewithkyrian\Transformers\Commands\DownloadModelCommand()); + // TODO: remove when upgrading to Symfony 8.0 where `addCommand` will be the only option + $addCommandMethodName = method_exists($application, 'addCommand') ? 'addCommand' : 'add'; + $application->$addCommandMethodName(new Codewithkyrian\Transformers\Commands\DownloadModelCommand()); $application->run(); } catch (Exception $e) {