Skip to content

Releases: shipsaas/never-throw

v2.0.0

05 Nov 06:34
Compare
Choose a tag to compare

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

15 Apr 02:28
Compare
Choose a tag to compare

Release

  • Changed self to static when creating new Result class

v1.0.0

12 Apr 16:31
Compare
Choose a tag to compare

v1.0.0

The initial release of PHP NeverThrow.

Use composer require shipsaas/never-throw to install and use Response-first in no time!