Skip to content

1.5.1

Choose a tag to compare

@mnapoli mnapoli released this 16 Sep 11:50
· 79 commits to master since this release

#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.