PHPackages                             dxw/result - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. dxw/result

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

dxw/result
==========

Result values

v1.0.6(2y ago)0130.0k↓13.2%12MITPHPPHP ^7.4||^8.1

Since Jul 19Pushed 2y ago11 watchersCompare

[ Source](https://github.com/dxw/result)[ Packagist](https://packagist.org/packages/dxw/result)[ Docs](https://github.com/dxw/result)[ RSS](/packages/dxw-result/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (3)Versions (10)Used By (2)

dxw/result
==========

[](#dxwresult)

Meant to be a drop-in replacement for [nikita2206/result](https://github.com/nikita2206/result), with one addition: `wrap()`.

`wrap()` was inspired by [github.com/pkg/errors](https://godoc.org/github.com/pkg/errors#Wrap).

Installation
------------

[](#installation)

```
composer require dxw/result

```

Usage
-----

[](#usage)

Returning values:

```
function myfunc(): \Dxw\Result\Result
{
    if (/* error */) {
        // getErr() will return 'something went wrong'
        return \Dxw\Result\Result::err('something went wrong');
    }

    return \Dxw\Result\Result::ok($value);
}

```

Handling `Result` values:

```
$result = myfunc();
if ($result->isErr()) {
    echo sprintf("Error: %s\n", $result->getErr());
    exit(1);
}
$value = $result->unwrap();

```

Returning errors from other errors:

```
function anotherfunc(): \Dxw\Result\Result
{
    $result = myfunc();
    if ($result->isErr()) {
        // getErr() will return 'got invalid value: something went wrong'
        return $result->wrap('got invalid value');
    }
    // do something with $result->unwrap()
}

```

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity32

Limited adoption so far

Community23

Small or concentrated contributor base

Maturity78

Established project with proven stability

 Bus Factor1

Top contributor holds 50% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~426 days

Recently: every ~536 days

Total

7

Last Release

1034d ago

PHP version history (3 changes)v1.0.4PHP ^7.2

v1.0.5PHP ^7.4||^8.2

v1.0.6PHP ^7.4||^8.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/370665?v=4)[Rob Skilling](/maintainers/RobjS)[@RobjS](https://github.com/RobjS)

![](https://avatars.githubusercontent.com/u/1659723?v=4)[jkeasley](/maintainers/jkeasley)[@jkeasley](https://github.com/jkeasley)

![](https://avatars.githubusercontent.com/u/4721596?v=4)[Matthew Passmore](/maintainers/matpassmore)[@matpassmore](https://github.com/matpassmore)

![](https://avatars.githubusercontent.com/u/71827088?v=4)[Serena Piccioni](/maintainers/serena-piccioni)[@serena-piccioni](https://github.com/serena-piccioni)

---

Top Contributors

[![mallorydxw](https://avatars.githubusercontent.com/u/2256130?v=4)](https://github.com/mallorydxw "mallorydxw (25 commits)")[![RobjS](https://avatars.githubusercontent.com/u/370665?v=4)](https://github.com/RobjS "RobjS (16 commits)")[![snim2](https://avatars.githubusercontent.com/u/97674?v=4)](https://github.com/snim2 "snim2 (6 commits)")[![patdel0](https://avatars.githubusercontent.com/u/53922624?v=4)](https://github.com/patdel0 "patdel0 (2 commits)")[![robbiepaul](https://avatars.githubusercontent.com/u/2804149?v=4)](https://github.com/robbiepaul "robbiepaul (1 commits)")

---

Tags

composergovpresspackagistphp

###  Code Quality

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/dxw-result/health.svg)

```
[![Health](https://phpackages.com/badges/dxw-result/health.svg)](https://phpackages.com/packages/dxw-result)
```

###  Alternatives

[cytopia/awesome-ci

Lot's of tools for git, file and static source code analysis.

3386.4k](/packages/cytopia-awesome-ci)[vich/geographical-bundle

Geographical functionality for ORM and ODM entities and JavaScript maps rendering

10428.0k](/packages/vich-geographical-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
