Release v2.0.0
v2.0.0 introduces breaking changes. However, the migration is simple.
New base classes
We introduced 2 new abstract classes:
- SuccessResult
- ErrorResult
You'll need to extend those classes corresponding to your Success/Error result classes. This guarantees the strictly typed.
Obsoleted methods
::ok()
and ::err
static methods are obsoleted & removed. You need to initialize the Result
class.
$result = new TransferResult(new TransferSuccessResult(...));
LogicException
Will be thrown if you try to invoke "getErrorResult" on a "SuccessResult" and vice-versa. This helps you to reduce early bugs (typos, mistakes,...)
$result = new TransferResult(new TransferSuccessResult(...));
$result->getErrorResult(); // will throw LogicException