PHPackages                             vadage/oxidize - 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. vadage/oxidize

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

vadage/oxidize
==============

PHP adaptation of some rust concepts

v1.0.0(2y ago)114MITPHPPHP &gt;=8.2

Since Apr 6Pushed 2y ago1 watchersCompare

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

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

> PHP adaptation of some great concepts on which Rust was built.

Oxidize
=======

[](#oxidize)

Rust encourages developers to handle errors and non-values properly by design.
This leads to fewer non-logic bugs in production and the code might look cleaner as well.

The Oxidize library is written in pure PHP and has just *adapted* some concepts, which are also used in Rust. The method names are kept similar (snake\_case to camelCase) for developers using both languages.
There are some additional wrapper methods, such as `andThenContinue()` in both `Result` and `Option` to get rid of return statements. A new instance will then be returned automatically.

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

[](#installation)

```
composer require vadage/oxidize
```

Exceptionless
-------------

[](#exceptionless)

Exceptions don't have to be declared to be thrown in a method, which increases the likelihood of them not being handled.
This is where `Result`s come in handy with their representation of `Ok` and `Error`. Calling `unwrap` on `Error` or `unwrapError` on `Ok` will lead to a `ValueAccessError`.

```
$userResult = $this->userRpc->login($email, $password);
if ($userResult->isOk()) {
    $user = $userResult->unwrap();
    $this->messages->queue(sprintf('Hello %1$s.', $user->getUsername()));
}
```

Null safety
-----------

[](#null-safety)

It may not always be obvious if a method returns an object or null.
Instead of `null`, an `Option` can be used, which represents one of two states (`Some` and `None`). Calling `unwrap` on `None` will lead to a `ValueAccessError`.

```
$terminationDateOption = $user->getTerminationDate();
if ($terminationDateOption->isSome()) {
    $terminationDate = $terminationDateOption->unwrap();
    $this->messages->queue(sprintf('Your login will be deactivated after %1$s.', $terminationDate->format(DateTimeInterface::RSS)));
}
```

Monads for Result and Option
----------------------------

[](#monads-for-result-and-option)

Monads can improve the codes aesthetics by getting rid of some `if` statements, variable declarations and `unwrap` calls.

```
$this->userRpc->login($email, $password)->andThenContinue(function (User $user) {
    $username = $user->getUsername();

    $user->getTerminationDate()
        ->andThenContinue(function (DateTime $terminationDate) {
            $formattedDate = $terminationDate->format(DateTimeInterface::RSS);
            $this->messages->queue(sprintf('Hello %1$s. Your login will be deactivated after %2$s.', $username, $formattedDate));
        })
        ->orElseContinue(function () {
            $this->messages->queue(sprintf('Hello %1$s.', $username));
        });
});
```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

772d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2e8d15910f65781d6152854ef7f1a2a36f3d5a1190c67bf9e83716af434c535d?d=identicon)[vadage](/maintainers/vadage)

---

Top Contributors

[![vadage](https://avatars.githubusercontent.com/u/29509078?v=4)](https://github.com/vadage "vadage (1 commits)")

---

Tags

exceptionlessmonadnullsafenullsafetyoxidizephpmonadrustoxidizenullsafeexceptionlessnullsafety

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/vadage-oxidize/health.svg)

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

###  Alternatives

[marcosh/lamphpda

A collection of functional programming data structures

12313.5k4](/packages/marcosh-lamphpda)[chippyash/monad

Functional programming Monad support

2828.1k8](/packages/chippyash-monad)[shrink0r/monatic

Fiddling with the monad concept in php

245.3k2](/packages/shrink0r-monatic)

PHPackages © 2026

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