---
title: "sebastian/code-unit 3.0.0 Breaking Changes on Packagist"
description: "What each sebastian/code-unit release removed, renamed or changed: 15 breaking changes in 2 versions on Packagist, each with its source."
canonical_url: https://since.dev/packages/packagist/sebastian/code-unit
last_updated: 2026-12-04
---

# sebastian/code-unit breaking changes

sebastian/code-unit 3.0.0 (February 2, 2024) is its newest release with breaking changes, 11 of them. The first: sebastian/code-unit 3.0.0 drops support for PHP 8.1. Every breaking API change we have recorded in sebastian/code-unit on Packagist: 15 breaking changes in 2 versions. Below, its 2 versions with breaking changes, newest first, removals and renames first, each with its source.

Updated December 4, 2026

Latest version `3.0.3`, released March 19, 2025. BSD-3-Clause license. [Source repository](https://github.com/sebastianbergmann/code-unit)

Its 3.0.0 release drops [PHP 8.1](https://since.dev/calendar/php/8.1.md). [PHP end of life dates](https://since.dev/calendar/php.md).

- From [2.0.0](#v-2-0-0) to [3.0.0](#v-3-0-0): 11 breaking changes in 1 version.

## sebastian/code-unit 3.0.0 breaking changes

sebastian/code-unit 3.0.0, released February 2, 2024: 11 breaking changes.

- **Removed**  

The package no longer supports PHP 8.1, so users on PHP 8.1 must stay on version 2.x or upgrade PHP. [github.com](https://github.com/sebastianbergmann/code-unit/blob/3.0.0/ChangeLog.md)
- **Signature changed** `SebastianBergmann\CodeUnit\ClassMethodUnit`  

Was final class ClassMethodUnit extends CodeUnit; now final readonly class ClassMethodUnit extends CodeUnit. [packagist.org](https://packagist.org/packages/sebastian/code-unit#3.0.0)
- **Signature changed** `SebastianBergmann\CodeUnit\ClassUnit`  

Was final class ClassUnit extends CodeUnit; now final readonly class ClassUnit extends CodeUnit. [packagist.org](https://packagist.org/packages/sebastian/code-unit#3.0.0)
- **Signature changed** `SebastianBergmann\CodeUnit\CodeUnit`  

Was abstract class CodeUnit; now abstract readonly class CodeUnit. [packagist.org](https://packagist.org/packages/sebastian/code-unit#3.0.0)
- **Signature changed** `SebastianBergmann\CodeUnit\CodeUnitCollection`  

Was final class CodeUnitCollection implements Countable, IteratorAggregate; now final readonly class CodeUnitCollection implements Countable, IteratorAggregate. [packagist.org](https://packagist.org/packages/sebastian/code-unit#3.0.0)
- **Signature changed** `SebastianBergmann\CodeUnit\FileUnit`  

Was final class FileUnit extends CodeUnit; now final readonly class FileUnit extends CodeUnit. [packagist.org](https://packagist.org/packages/sebastian/code-unit#3.0.0)
- **Signature changed** `SebastianBergmann\CodeUnit\FunctionUnit`  

Was final class FunctionUnit extends CodeUnit; now final readonly class FunctionUnit extends CodeUnit. [packagist.org](https://packagist.org/packages/sebastian/code-unit#3.0.0)
- **Signature changed** `SebastianBergmann\CodeUnit\InterfaceMethodUnit`  

Was final class InterfaceMethodUnit extends CodeUnit; now final readonly class InterfaceMethodUnit extends CodeUnit. [packagist.org](https://packagist.org/packages/sebastian/code-unit#3.0.0)
- **Signature changed** `SebastianBergmann\CodeUnit\InterfaceUnit`  

Was final class InterfaceUnit extends CodeUnit; now final readonly class InterfaceUnit extends CodeUnit. [packagist.org](https://packagist.org/packages/sebastian/code-unit#3.0.0)
- **Signature changed** `SebastianBergmann\CodeUnit\TraitMethodUnit`  

Was final class TraitMethodUnit extends CodeUnit; now final readonly class TraitMethodUnit extends CodeUnit. [packagist.org](https://packagist.org/packages/sebastian/code-unit#3.0.0)
- **Signature changed** `SebastianBergmann\CodeUnit\TraitUnit`  

Was final class TraitUnit extends CodeUnit; now final readonly class TraitUnit extends CodeUnit. [packagist.org](https://packagist.org/packages/sebastian/code-unit#3.0.0)

## sebastian/code-unit 2.0.0 breaking changes

sebastian/code-unit 2.0.0, released February 3, 2023: 4 breaking changes.

- **Removed**  

The component no longer supports PHP 7.3, PHP 7.4 or PHP 8.0. Upgrade PHP before using version 2.0.0. [github.com](https://github.com/sebastianbergmann/code-unit/blob/2.0.0/ChangeLog.md)
- **Removed** `SebastianBergmann\CodeUnit\CodeUnitCollection::fromArray`  

The fromArray() method was removed in 2.0.0. Stop calling it and build collections another way. [packagist.org](https://packagist.org/packages/sebastian/code-unit#2.0.0)
- **Behavior changed** `SebastianBergmann\CodeUnit\Mapper.stringToCodeUnits`  

stringToCodeUnits() no longer supports the ClassName<\*> notation. Pass the class name without the wildcard syntax. [github.com](https://github.com/sebastianbergmann/code-unit/blob/2.0.0/ChangeLog.md)
- **Signature changed** `SebastianBergmann\CodeUnit\CodeUnitCollection::fromList`  

Was public static function fromList(CodeUnit ...$items): self; now public static function fromList(CodeUnit ...$codeUnits): self. [packagist.org](https://packagist.org/packages/sebastian/code-unit#2.0.0)

## Related packages

- [sebastian/cli-parser](https://since.dev/packages/packagist/sebastian/cli-parser.md)
- [sebastian/code-unit-reverse-lookup](https://since.dev/packages/packagist/sebastian/code-unit-reverse-lookup.md)
- [sebastian/comparator](https://since.dev/packages/packagist/sebastian/comparator.md)
- [sebastian/complexity](https://since.dev/packages/packagist/sebastian/complexity.md)
- [sebastian/diff](https://since.dev/packages/packagist/sebastian/diff.md)
- [sebastian/environment](https://since.dev/packages/packagist/sebastian/environment.md)

## Check your code

These are the changes. To see which of them reach your code, [scan a public repository](https://since.dev/scan.md), or have your coding agent call `check_code` with your manifest or lockfile over [MCP](https://since.dev/docs.md#mcp). [The API](https://since.dev/docs.md#api) reads every change in every version. A fix pull request opens for the changes that reach a connected repository. Nothing merges or deploys.

## Put your code on continuous maintenance.

Scan a public repository now, or give your agent one line.

[Scan a repository](https://since.dev/scan.md). Any public GitHub repository. No sign-in.

### Tell your agent what changed since it was trained.

`claude mcp add --transport http since https://api.since.dev/mcp`

[Get an API key](https://app.since.dev/login?mode=signup)

Codex, Cursor and any MCP client use https://api.since.dev/mcp.

---

Every page on this site as Markdown: https://since.dev/sitemap.md. For agents: https://since.dev/llms.txt.
