cloudcreativity / json-api

Framework agnostic JSON API serialisation and deserialisation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Inject error repository into `AbstractAuthorizer` by default

lindyhopchris opened this issue · comments

As best practice is to create errors via an instance of the ErrorRepositoryInterface, inject this into the AbstractAuthorizer by default.

Add a new trait to use instead of ErrorsAwareTrait that has an addError method that accepts either an ErrorInterface object or a string. If a string, will create the error from the repository. The method should return the error that was added so that methods such as setDetail can then be chained off it.

Closing as this is available via Componser on the v0.6.x-dev release