Changelog History
-
v1.7.2 Changes
November 26, 2019Compatibility with Symfony 5.
-
v1.7.1 Changes
December 26, 2018๐ฆ Lighter package when installed via Composer
-
v1.7.0 Changes
November 18, 2017- ๐ #44 Symfony 4 support
-
v1.6.0 Changes
May 22, 2017๐ #39 Support PHP 7.0 and up only
๐ #36 & #38 Allow to inject the
SymfonyStyle
object introduced in Symfony 2.8use \Symfony\Component\Console\Style\SymfonyStyle;...$app-\>command('greet', function (SymfonyStyle $io) {$io-\>write('hello');});
-
v1.5.1 Changes
September 16, 2016๐ป #27, #28, #29: Throw an explicit exception when commands are registered as static calls to non static method calls.
Wrong way:
$this-\>application-\>command('greet', ['MyClass', 'foo']);class MyClass {public function foo() { ... }}
๐ป That will now correctly throw an exception.
This should be used instead:
$this-\>application-\>command('greet', [new MyClass(), 'foo']);
๐ Or you can use dependency injection with an autowiring container (http://mnapoli.fr/silly/docs/dependency-injection.html), for example with PHP-DI: http://mnapoli.fr/silly/docs/dependency-injection.html That way you don't have to change your code.
-
v1.5.0 Changes
August 31, 2016๐ This release contains improvements on command arguments and options, by @thecrypticace:
๐ Allow options to have default values (#25, documentation)
$app-\>command('greet [--age=]', function ($age) {// ...})-\>defaults(['age' =\> 25,]);;
๐ Default values can now be inferred from the callable's parameters (#25, documentation)
$app-\>command('greet [name] [--age=]', function ($name = 'John', $age = 25) {// ...});
๐ Fixed: matching arguments and options containing hyphens (#26, documentation)
$app-\>command('run [--dry-run]', function ($dryRun) {// ...});
-
v1.4.0 Changes
August 13, 2016 -
v1.3.1 Changes
August 01, 2016- #22 Make the descriptions() setter fluent
-
v1.3.0 Changes
February 27, 2016#20: compatibility with Symfony 3.x as well as 2.x.
-
v1.2.0 Changes
February 01, 2016๐ Improvements
#17 Run a sub-command easily with
runCommand()
, for example:$app-\>command('init', function ($input, $output) {$this-\>runCommand('db:drop --force', $output)$this-\>runCommand('db:create', $output)$this-\>runCommand('db:fixtures --verbose', $output)});
๐ Bugfixes
- #19 Exit codes returned by commands were not returned by the application