As discussed with @Ocramius today it would make sense for Disco to be able to support autowiring for bean instances to reduce the amount of configuration code needed and to be able to get rid of traits for structuring the configuration code.
The following configuration:
/** @Bean */
protected function database() : Database
{
return new Database('mysql://user:secret@localhost/mydb');
}
/** @Bean */
public function productService() : ProductService
{
return new ProductService($this->database());
}
could then be simplified like this:
/** @Bean */
protected function database() : Database
{
return new Database('mysql://user:secret@localhost/mydb');
}
/** @Bean */
abstract public function productService() : ProductService;
At a later stage we could move the methods into separate interfaces - to be able to get rid of the abstract keyword and ultimately get rid of the trait approach.
A few problems need to be solved:
As discussed with @Ocramius today it would make sense for Disco to be able to support autowiring for bean instances to reduce the amount of configuration code needed and to be able to get rid of traits for structuring the configuration code.
The following configuration:
could then be simplified like this:
At a later stage we could move the methods into separate interfaces - to be able to get rid of the
abstractkeyword and ultimately get rid of the trait approach.A few problems need to be solved: