ackintosh / ganesha

:elephant: A Circuit Breaker pattern implementation for PHP applications.
https://ackintosh.github.io/ganesha/
MIT License
585 stars 42 forks source link

Fix backward incompatibility in v1.2.1 #81

Closed ackintosh closed 3 years ago

ackintosh commented 3 years ago

related issue: https://github.com/ackintosh/ganesha/issues/80

This fix is to ease the backward incompatibility in 1.2.1.

Unfortunately this does not completely fix the incompatibility. If you are using your custom adapter, please add setContext method like below in order to keep behaviors of your adapter.

If your custom adapter extends a built in adapter like below, it is recommended to use the parent implementation:

class CustomAdapter extends \Ackintosh\Ganesha\Storage\Adapter\Memcached
{
    // Comment out to use the parent implementation
    // public function setContext(Ganesha\Context $context): void
    // {
    // }
}

or if your custom adapter using no built in adapter, please add an empty setContext method to satisfy AdapterInterface requirement.

class CustomAdapter implements \Ackintosh\Ganesha\Storage\AdapterInterface
{
    public function setContext(Ganesha\Context $context): void
    {
         // nop
    }
}
coveralls commented 3 years ago

Coverage Status

Coverage decreased (-0.3%) to 91.736% when pulling 7abb09afa1831e015c34546c9d893656774363ad on fix-backward-incompatibility into a225863a628be2158a5e8851fbf1b7af7e0f5a1d on master.