Skip to content

v2.0.0

Latest
Compare
Choose a tag to compare
@sethsandaru sethsandaru released this 05 Nov 06:34

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