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

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

kharanenka/php-result-store
===========================

Universal result store

2.3.0(6y ago)341.8k↓60.7%11GPL-3.0PHPPHP &gt;=7.0

Since Sep 16Pushed 6y ago1 watchersCompare

[ Source](https://github.com/kharanenka/php-result-store)[ Packagist](https://packagist.org/packages/kharanenka/php-result-store)[ RSS](/packages/kharanenka-php-result-store/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (1)Versions (10)Used By (1)

Class Result
============

[](#class-result)

Universal result store:

- status (bool)
- data (mixed)
- message (string)
- code (string)

Installation
============

[](#installation)

Require this package in your `composer.json` and update composer.

```
"kharanenka/php-result-store": "2.2.*"

```

Usage
=====

[](#usage)

You can use class "Result" in any places your application. Class "Result" is singleton.

Set result data methods:
------------------------

[](#set-result-data-methods)

- setData(mixed $obData) - Set result data
- setTrue(mixed $obData = null) - Set result data with status "true"
- setFalse(mixed $obData = null) - Set result data with status "false"
- setMessage(string $sMessage) - Set message string
- setCode(string $sCode) - Set code value

Get result data method:
-----------------------

[](#get-result-data-method)

- status() - Get result status flag true/false
- data() - Get data value (object/array/string)
- message() - Get message value
- code() - Get code value
- get() - Get array result array
- getJSON() - Get array result array in JSON string

```
    //Result array
    [
        'status'    => false/true
        'data'      => object
        'message'   => 'Message text',
        'code'      => 1015,
    ]
```

```
    //Example 1
    Result::setMessage('Error')->setCode(400)->setFalse();

    ...
    if(!Result::status()) {
        return Result::get();
    }

    //Example 2
    return Result::setTrue($obData)->getJSON();
```

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity32

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 57.1% 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 ~149 days

Recently: every ~255 days

Total

8

Last Release

2531d ago

Major Versions

1.0.4 → 2.0.02017-05-31

PHP version history (2 changes)1.0.0PHP &gt;=5.5

2.2.0PHP &gt;=7.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/f72dfe2a14224cf1e368ddefcd7886bbe7be751a21fe77227175ba21ebfab823?d=identicon)[Andrey Kharanenka](/maintainers/Andrey%20Kharanenka)

---

Top Contributors

[![kharanenka](https://avatars.githubusercontent.com/u/18258760?v=4)](https://github.com/kharanenka "kharanenka (4 commits)")[![peter279k](https://avatars.githubusercontent.com/u/9021747?v=4)](https://github.com/peter279k "peter279k (3 commits)")

---

Tags

phpresultstore

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[imanghafoori/laravel-anypass

A minimal yet powerful package to help you in development.

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

PHPackages © 2026

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