PHPackages                             withinboredom/common-records - 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. withinboredom/common-records

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

withinboredom/common-records
============================

Common scalar records

v0.2.0(11mo ago)20[1 PRs](https://github.com/withinboredom/common-records/pulls)MITPHPCI passing

Since Jun 9Pushed 5mo ago1 watchersCompare

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

READMEChangelog (3)Dependencies (4)Versions (5)Used By (0)

Common Records
==============

[](#common-records)

Install:

```
composer require withinboredom/common-records

```

This is a generated collection of common records (see [generator.php](generator.php)).

Included:

- DateTime
- NegativeFloat
- NegativeInt
- NonNegativeInt
- NonZeroFloat
- NonZeroInt
- Percentage
- PositiveFloat
- PositiveInt
- AlphaNumericString
- AlphaString
- LowercaseString
- NonEmptyString
- Slug
- TrimmedString
- UppercaseString

Convention
----------

[](#convention)

1. Every type is also created as a function of the same name.
2. Every type implements `__invoke(): self` to extract the original value
3. Every type is strongly equal to another type of the same value (a record)

Example Usage
-------------

[](#example-usage)

```
class User {
  public function __construct(
    public NonEmptyString $name,
    public PositiveInt $id,
  ) {}
}

$user = new User(NonEmptyString('Rob'), PositiveInt(123))

function getById(int $id) {
  /* do stuff */
}

getById($user->id() /* call __invoke to get the integer value */);
```

Contributing
------------

[](#contributing)

1. Fork this repository.
2. Add the new type to [`generator.php`](generator.php).
3. Execute `generator.php` and maybe add some tests.
4. Update the list in this readme.
5. Open a PR.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance63

Regular maintenance activity

Popularity3

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity30

Early-stage or recently created project

 Bus Factor1

Top contributor holds 71.4% 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 ~0 days

Total

3

Last Release

343d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8f5995953815a492e3bf6276044042d84035247139141ec7fd013c13af4e6dd4?d=identicon)[withinboredom](/maintainers/withinboredom)

---

Top Contributors

[![withinboredom](https://avatars.githubusercontent.com/u/1883296?v=4)](https://github.com/withinboredom "withinboredom (10 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (4 commits)")

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/withinboredom-common-records/health.svg)

```
[![Health](https://phpackages.com/badges/withinboredom-common-records/health.svg)](https://phpackages.com/packages/withinboredom-common-records)
```

###  Alternatives

[romdim/yii2-bootstrap-material

Composer package for implementing FezVrasta's bootstrap material design in Yii2.

2010.9k3](/packages/romdim-yii2-bootstrap-material)

PHPackages © 2026

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