PHPackages                             takeoto/state - 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. takeoto/state

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

takeoto/state
=============

Abstraction for the state of system processes.

01PHP

Since May 6Pushed 3y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

State
=====

[](#state)

### Abstraction for the state of system processes

[](#abstraction-for-the-state-of-system-processes)

#### Usage

[](#usage)

```
use Takeoto\State\State;
use Takeoto\Message\NoticeMessage;
use Takeoto\Message\ErrorMessage;
use Takeoto\Message\WarningMessage;
use Takeoto\State\Utility\StateUtility;

$state = new State([
    new NoticeMessage('☀️The notice message.'),
    new WarningMessage('⚠️The warning message!'),
    new ErrorMessage(500, 'The error message ‼️'),
]);

$state->isOk(); # false
StateUtility::ensure($state); # Throws an exception

# ---

$state = new State([
    new NoticeMessage('☀️The notice message.'),
    new WarningMessage('⚠️The warning message!'),
]);
$state->isOk(); # true

# ---

$state = new State([], true);
$state->isOk(); # true

# ---

# $service = new SomeService();
# $state = $service->doSomeWork(...$args);
#
# if (!$state->isOk()) {
#   throw new \RuntimeException($state->getMessages()->getErrors()->first());
# }
```

###  Health Score

13

—

LowBetter than 1% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity1

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity22

Early-stage or recently created project

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.

### Community

Maintainers

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

### Embed Badge

![Health badge](/badges/takeoto-state/health.svg)

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

PHPackages © 2026

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