Disco 0.10.0 - an exceptional release

Disco 0.10.0 - an exceptional release

It's been a while since the last Disco release. Over the last few months quite a few improvements have been made to the code, new features have been added and unfortunately some BC breaks had to be done. As always, find the BC breaks covered in the upgrade guide.

Disco 0.10.0 - codename "the exceptional release" - will no longer run on PHP 7.0 or PHP 7.1, it requires PHP 7.2. The reason for this is the upgrade of the ocramius/proxy-manager package to its latest version. Since PHP 7.2 is out for quite a while now, this should not be a real show-stopper for users - if so, let us know! In addition to that return type hints were added, which means in case you implement an interface provided by Disco you need to change your code accordingly. Thank you @senseException for the hard work!

This version of Disco makes it easier for you to deal with aliases, especially when you are in need to overwrite an alias to configure your application slightly differently for development or production mode. So far this was only possible by overriding the same method of the parent class in the child class and configure the same alias. Due to the required return typehints this could be a problem in a few cases - looking at you Expressive ;) Thanks to @heiglandreas aliases are now scoped to the class they appear in. Also, protected methods are not required to be annotated with the @Bean annotation any more, again to help you to overwrite methods in subclasses if needed.

class ProductionConfig
{
    /**
     * @Bean({
     *   "aliases"={
     *      @Alias({"name" = "Alias1"})
     *   }
     * })
     */
    public function instance1() : MyType
    {}
}

class DevelopmentConfig extends ProductionConfig
{
    /**
     * @Bean({
     *   "aliases"={
     *      @Alias({"name" = "Alias1"})
     *   }
     * })
     */
    public function instance2() : MyOtherType
    {}
}


Finally thank you @kalessil for a few minor optimizations to make sure that the "code is in great shape".



Tags: ,

Eintrag von Stephan Hochdörfer am 20.03.2018

comments powered by Disqus