PHPackages                             componenta/default-value - 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. componenta/default-value

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

componenta/default-value
========================

Default value sentinel for Componenta packages

v1.0.0(1mo ago)011MITPHPPHP ^8.4

Since Jun 16Pushed 1mo agoCompare

[ Source](https://github.com/componenta/default-value)[ Packagist](https://packagist.org/packages/componenta/default-value)[ RSS](/packages/componenta-default-value/feed)WikiDiscussions main Synced 1w ago

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

Componenta Default Value
========================

[](#componenta-default-value)

Single marker enum for distinguishing an omitted default value from an explicit `null`.

Use it in APIs where `null` is a meaningful caller-provided value and cannot also mean "argument was not provided".

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

[](#installation)

```
composer require componenta/default-value
```

Related Packages
----------------

[](#related-packages)

PackageWhy it matters here`componenta/di`Uses `DefaultValue::None` in attributes where `null` can be an explicit default.`componenta/config`Useful for APIs that distinguish an omitted fallback from a `null` fallback.Usage
-----

[](#usage)

```
use Componenta\Stdlib\DefaultValue;

function readOption(string $name, mixed $default = DefaultValue::None): mixed
{
    if ($default === DefaultValue::None) {
        return loadRequiredOption($name);
    }

    return loadOptionalOption($name, $default);
}
```

Passing `null` remains explicit:

```
readOption('cache.ttl', null); // default is intentionally null
```

Contract
--------

[](#contract)

`DefaultValue::None` means no default value was provided. It is intentionally a marker, not a container and not a replacement for `Option`/`Maybe` value objects.

When To Use
-----------

[](#when-to-use)

Use this package for function arguments, resolver APIs, config helpers, and factories that need to preserve the difference between:

- no fallback was given
- fallback was given and the fallback is `null`

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance91

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity51

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

44d ago

### Community

Maintainers

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

---

Top Contributors

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

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/componenta-default-value/health.svg)

```
[![Health](https://phpackages.com/badges/componenta-default-value/health.svg)](https://phpackages.com/packages/componenta-default-value)
```

###  Alternatives

[esensi/core

The foundational components of Esensi

232.1k](/packages/esensi-core)

PHPackages © 2026

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