• v2.0.0 c61ff7a831

    v2.0.0 Stable

    danieljsummers released this 2024-11-21 03:21:19 +00:00 | 0 commits to main since this release

    With this release, the PHP 8.4 version of this library is now generally available.

    The only change since RC 1 is that tests have been converted to run via Pest instead of PHPUnit.

    Downloads
  • v1.0.0 3cc780956d

    v1.0.0 Stable

    danieljsummers released this 2024-11-21 02:47:24 +00:00 | 0 commits to v1 since this release

    With this release, the PHP 8.2 (and 8.3) version of this library is now generally available.

    The only change since RC 1 is that tests have been converted to run via Pest instead of PHPUnit.

    Downloads
  • v2.0.0-rc1 9327d8fa29

    v2, RC 1 Pre-Release

    danieljsummers released this 2024-10-01 03:10:40 +00:00 | 1 commits to main since this release

    This release candidate moves the project to PHP 8.4.

    • In both Option and Result, the is* functions are now properties.
    • In Option, get() is now the value property. Other functions, like getOrDefault(), remain the same.
    • In Result, getOK() and getError() are now ok and error properties.
    Downloads
  • v1.0.0-rc1 6779b2c554

    v1, RC 1 Pre-Release

    danieljsummers released this 2024-10-01 00:21:02 +00:00 | 3 commits to main since this release

    This the first release candidate for the library. It restricts PHP versions to 8.2-8.3; version 2 will support 8.4 and above, using properties instead of functions where appropriate.

    Downloads
  • v1.0.0-beta2 fad428a4e4

    v1, Beta 2 Pre-Release

    danieljsummers released this 2024-07-29 20:50:13 +00:00 | 4 commits to main since this release

    BREAKING CHANGE
    Option->is() has been renamed Option->contains() for consistency with Result (and any future collection implementation).

    FEATURES
    Both Option and Result now support:

    • bind: takes a callback that accepts the Some or OK value and returns an Option or Result, respectively. If the Option is None or the Result is Error, the callback will be skipped. This allows what is termed "railway-oriented programming" where every call is an opportunity to short-circuit the rest of the calls and return the Error result (or None).
    • contains: takes a value and an optional strict: parameter; it returns true if the Some or OK value matches the value provided, or false otherwise.
    • exists: takes a callback that accepts the Some or OK value and returns bool; None or Error results always return false.
    • toArray: converts a Some Option and an OK Result to a one-item array, and converts a None Option and an Error Result to an empty array.

    Additionally, Option now has a getOrThrow method that takes a callback that returns an Exception. If the Option is Some, the value is returned; if it is None, the callback is called and the resulting Exception is thrown.

    Downloads
  • v1.0.0-beta1 efb3a4461e

    v1, Beta 1 Pre-Release

    danieljsummers released this 2024-07-28 21:38:12 +00:00 | 6 commits to main since this release

    This is the initial release of this library; see the README for what, how, and why. :)

    Downloads