PHPackages                             sebastian/code-unit - 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. [Testing &amp; Quality](/categories/testing)
4. /
5. sebastian/code-unit

ActiveLibrary[Testing &amp; Quality](/categories/testing)

sebastian/code-unit
===================

Collection of value objects that represent the PHP code units

3.0.3(1y ago)1.2k522.3M↓12%716BSD-3-ClausePHPPHP &gt;=8.2CI passing

Since Mar 30Pushed 11mo ago3 watchersCompare

[ Source](https://github.com/sebastianbergmann/code-unit)[ Packagist](https://packagist.org/packages/sebastian/code-unit)[ Docs](https://github.com/sebastianbergmann/code-unit)[ GitHub Sponsors](https://github.com/sebastianbergmann)[ RSS](/packages/sebastian-code-unit/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (1)Versions (16)Used By (16)

[![No Maintenance Intended](https://camo.githubusercontent.com/a527ad34c8e95a96952ba81a6aa421bc0fd9c18d55bd2b2cb28ff644f428f665/68747470733a2f2f756e6d61696e7461696e65642e746563682f62616467652e737667)](https://unmaintained.tech/)[![Latest Stable Version](https://camo.githubusercontent.com/59837cfdf9d2e47e608693d345427df5f2fcb3a9b49058b0b6a17642cd3f0a9d/68747470733a2f2f706f7365722e707567782e6f72672f73656261737469616e2f636f64652d756e69742f76)](https://packagist.org/packages/sebastian/code-unit)[![CI Status](https://github.com/sebastianbergmann/code-unit/workflows/CI/badge.svg)](https://github.com/sebastianbergmann/code-unit/actions)[![codecov](https://camo.githubusercontent.com/ee435610baa37ea52a232b820d8ea22b3119f67452448e2618dc35a9c35af75f/68747470733a2f2f636f6465636f762e696f2f67682f73656261737469616e626572676d616e6e2f636f64652d756e69742f6272616e63682f6d61696e2f67726170682f62616467652e737667)](https://codecov.io/gh/sebastianbergmann/code-unit)

sebastian/code-unit
===================

[](#sebastiancode-unit)

Collection of value objects that represent the PHP code units.

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

[](#installation)

You can add this library as a local, per-project dependency to your project using [Composer](https://getcomposer.org/):

```
composer require sebastian/code-unit

```

If you only need this library during development, for instance to run your project's test suite, then you should add it as a development-time dependency:

```
composer require --dev sebastian/code-unit

```

Please note that this is now a [low maintenance project](https://github.com/sebastianbergmann/code-unit/blob/main/.github/CONTRIBUTING.md#low-maintenance-project).

###  Health Score

62

—

FairBetter than 99% of packages

Maintenance48

Moderate activity, may be stable

Popularity77

Solid adoption and visibility

Community27

Small or concentrated contributor base

Maturity76

Established project with proven stability

 Bus Factor1

Top contributor holds 97.6% 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 ~129 days

Recently: every ~102 days

Total

15

Last Release

425d ago

Major Versions

1.0.8 → 2.0.02023-02-03

2.0.0 → 3.0.02024-02-02

2.0.x-dev → 3.0.32025-03-19

PHP version history (5 changes)1.0.0PHP ^7.3

1.0.4PHP ^7.3 || ^8.0

1.0.6PHP &gt;=7.3

2.0.0PHP &gt;=8.1

3.0.0PHP &gt;=8.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1089?v=4)[Sebastian Probst Eide](/maintainers/sebastian)[@sebastian](https://github.com/sebastian)

---

Top Contributors

[![sebastianbergmann](https://avatars.githubusercontent.com/u/25218?v=4)](https://github.com/sebastianbergmann "sebastianbergmann (441 commits)")[![SamMousa](https://avatars.githubusercontent.com/u/547021?v=4)](https://github.com/SamMousa "SamMousa (7 commits)")[![jdreesen](https://avatars.githubusercontent.com/u/424602?v=4)](https://github.com/jdreesen "jdreesen (2 commits)")[![Ayesh](https://avatars.githubusercontent.com/u/811553?v=4)](https://github.com/Ayesh "Ayesh (1 commits)")[![cs278](https://avatars.githubusercontent.com/u/17377?v=4)](https://github.com/cs278 "cs278 (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/sebastian-code-unit/health.svg)

```
[![Health](https://phpackages.com/badges/sebastian-code-unit/health.svg)](https://phpackages.com/packages/sebastian-code-unit)
```

###  Alternatives

[phpspec/prophecy

Highly opinionated mocking framework for PHP 5.3+

8.5k551.7M682](/packages/phpspec-prophecy)[vimeo/psalm

A static analysis tool for finding errors in PHP applications

5.8k77.5M6.7k](/packages/vimeo-psalm)[brianium/paratest

Parallel testing for PHP

2.5k118.8M754](/packages/brianium-paratest)[beberlei/assert

Thin assertion library for input validation in business models.

2.4k96.9M570](/packages/beberlei-assert)[mikey179/vfsstream

Virtual file system to mock the real file system in unit tests.

1.4k108.0M2.7k](/packages/mikey179-vfsstream)[orchestra/testbench

Laravel Testing Helper for Packages Development

2.2k39.1M32.1k](/packages/orchestra-testbench)

PHPackages © 2026

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