Releases: shipsaas/never-throw
Releases · shipsaas/never-throw
v2.0.0
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
Documentation
v1.0.1
Release
- Changed
self
tostatic
when creating new Result class
v1.0.0
v1.0.0
The initial release of PHP NeverThrow.
Use composer require shipsaas/never-throw
to install and use Response-first in no time!