soeur/phpoar

There is no license information available for the latest version (dev-master) of this package.

Imitate the option and result of rust.

Installs: 1

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/soeur/phpoar

dev-master 2020-04-18 08:44 UTC

This package is auto-updated.

Last update: 2025-12-20 18:53:21 UTC


README

Imitate the option and result of rust.

Usage

function test1(\Phpoar\Option $opt) {}
function test2(\Phpoar\Result $result) {}

test1(\Phpoar\Some(1));
test1(\Phpoar\None());
test2(\Phpoar\Ok("ok"));
test2(\Phpoar\Err(new \Exception()));

Available

Result

  • unwrap
  • is_ok
  • is_err
  • ok
  • err
  • map
  • map_or
  • map_or_else
  • map_err
  • and
  • and_then
  • or
  • or_else
  • unwrap_or
  • unwrap_or_else

Option

  • unwrap
  • is_some
  • is_none
  • map
  • unwrap_or
  • unwrap_or_else