Skip to content

Commit 7e7e4cf

Browse files
authored
Merge pull request #823 from browscap/7.7.x-merge-up-into-7.8.x_Va3JxAv4
Merge release 7.7.1 into 7.8.x
2 parents 8cb7fc6 + fda4e8d commit 7e7e4cf

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

bin/browscap-php

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,22 @@ if (!$foundVendorAutoload) {
2222
}
2323

2424
use BrowscapPHP\Exception;
25-
use Symfony\Component\Console\Application;
2625
use BrowscapPHP\Command;
26+
use Symfony\Component\Console\Application as ConsoleApplication;
27+
use Symfony\Component\Console\Command\Command as ConsoleCommand;
28+
29+
class Application extends ConsoleApplication {
30+
public function add(callable|ConsoleCommand $command): ?ConsoleCommand
31+
{
32+
$symfonyConsoleVersion = Composer\InstalledVersions::getVersion('symfony/console');
33+
34+
if (version_compare($symfonyConsoleVersion, '7.4', '<')) {
35+
return parent::add($command);
36+
}
37+
38+
return parent::addCommand($command);
39+
}
40+
}
2741

2842
$cacheDirectory = $baseDir . '/resources/';
2943
$defaultIniFile = $baseDir . '/resources/browscap.ini';

0 commit comments

Comments
 (0)