PHPackages                             viodev/php-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. viodev/php-result

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

viodev/php-result
=================

Result object for php

4.0.0(7mo ago)244.6k↓33.3%1MITPHPPHP ^8.2

Since Aug 10Pushed 7mo agoCompare

[ Source](https://github.com/viodevni/php-result)[ Packagist](https://packagist.org/packages/viodev/php-result)[ RSS](/packages/viodev-php-result/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (10)Used By (0)

Php Result
==========

[](#php-result)

A simple php object for passing the result of an action back to the caller with optional data array and parseable string, if required.

### Success

[](#success)

#### Helper function

[](#helper-function)

```
$result = success('action_success', [
    'message' => 'Success!'
]);

```

#### Static method

[](#static-method)

```
$result = Result::success('action_success', [
    'message' => 'Success!'
]);

```

#### Result

[](#result)

```
Viodev\Result {
  +result: "success"
  +code: "action_success"
  +data: array:1 [
    "message" => "Success!"
  ]
}

$result->isSuccess() EQUALS true
$result->isFail() EQUALS false

```

### Fail

[](#fail)

#### Helper function

[](#helper-function-1)

```
$result = fail('action_fail', [
    'error' => 'An error occurred!'
]);

```

#### Static method

[](#static-method-1)

```
$result = Result::fail('action_fail', [
    'error' => 'An error occurred!'
]);

```

#### Result

[](#result-1)

```
Viodev\Result {
  +result: "fail"
  +code: "action_fail"
  +data: array:1 [
    "message" => "An error occurred!"
  ]
}

$result->isFail() EQUALS true
$result->isSuccess() EQUALS false

```

###  Health Score

48

—

FairBetter than 95% of packages

Maintenance62

Regular maintenance activity

Popularity32

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~234 days

Recently: every ~391 days

Total

9

Last Release

229d ago

Major Versions

1.0.2 → 2.0.02020-09-30

2.0.1 → 3.0.02024-02-08

3.1.1 → 4.0.02025-10-01

PHP version history (4 changes)1.0.0PHP &gt;=7.1.0

2.0.1PHP ^7.3|^8.0

3.0.0PHP ^8.0|^8.1|^8.2|^8.3

4.0.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/ee5c963abf271c7d8eb66b286c8807318061e7683f36b6eceb36d6a19c24bafb?d=identicon)[viodev](/maintainers/viodev)

---

Top Contributors

[![philvv](https://avatars.githubusercontent.com/u/20597147?v=4)](https://github.com/philvv "philvv (18 commits)")

---

Tags

php

### Embed Badge

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

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

###  Alternatives

[imanghafoori/laravel-anypass

A minimal yet powerful package to help you in development.

21421.6k](/packages/imanghafoori-laravel-anypass)

PHPackages © 2026

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