Skip to content
CAI
Software that uses CAICheck a score

sebastianbergmann/php-timer

66.4

Adequate · 13 November 2026

607

lines of production code

PHP

primary language

7

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

Features

Add timer-specific exception classes

The library now includes dedicated exception classes for timer-related errors: NoActiveTimerException is thrown when an operation requires an active timer but none is running, and TimeSinceStartOfRequestNotAvailableException is thrown when the time since the start of the request cannot be determined. These exceptions implement the new Exception interface, which extends PHP's Throwable, providing a structured way to handle timer-specific failures.

src/exceptions · high confidence

Added script to extract release notes from changelog

A new PHP script, \build/scripts/extract-release-notes.php\, has been added to the build tooling. This utility allows users to extract the release notes for a specific version tag from the \ChangeLog.md\ file, facilitating the automation of release processes when tags are pushed.

build · high confidence

Removals

Removal of PHP\_Timer utility class

The PHP\_Timer class has been removed from the codebase. This class previously provided static methods for timing operations, including starting/stopping timers, formatting elapsed time, and calculating resource usage based on server request time. Its removal eliminates the dependency on this specific timing utility.

PHP · high confidence

Behavioural changes

1 commit (0 fixes) modifying tools/.php-cs-fixer

A change to existing behaviour in tools/.php-cs-fixer — 1 commit, 20 files: “Manage PHP-CS-Fixer with Composer instead of Phive”.

tools/.php-cs-fixer · medium confidence · unverified

138 commits (0 fixes) modifying tools

A change to existing behaviour in tools — 138 commits, 3 files: “\* Have Composer in \tools/composer\ and managed through \composer self-update\ \* Install Psalm using Phive as \tools/psalm\ \* Install PHP-CS-Fixer using Phive as \tools/php-cs-fixer\”; “Update PHP-CS-Fixer”; “Update tools”; and 5 more.

tools · medium confidence · unverified

Modernized build automation and dropped PEAR distribution

The project has replaced its legacy PEAR packaging with a modern Composer-based workflow, removing the \package.xml\ file entirely. Build and tool management now rely on Phive for binaries (such as PHP-CS-Fixer and PHPStan) and Composer for dependencies, orchestrated via an Ant \build.xml\ script. Configuration files for PHPStan (level 10), PHPUnit, and PHP-CS-Fixer have been added to standardize code quality checks, while \.gitattributes\ and \.gitignore\ have been updated to exclude build artifacts and tool directories from repository exports.

(repo-wide) · high confidence

Refactored timer and resource usage into dedicated value objects

The timer functionality has been restructured to improve precision and reliability. A new \Duration\ value object now encapsulates time with nanosecond granularity, replacing previous float-based calculations. The \Timer\ class now uses \hrtime()\ for high-resolution timing and returns \Duration\ objects upon stopping. Additionally, a new \ResourceUsageFormatter\ class handles the formatting of time and memory consumption, explicitly relying on \$\_SERVER\['REQUEST\_TIME\_FLOAT'\]\ for request-start time calculations and throwing a specific exception if it is unavailable, thereby removing reliance on less reliable server variables.

src · high confidence

Test coverage

Migrated timer tests to PHPUnit 10 attributes and new value objects

The test suite for the timer component has been updated to use PHPUnit 10's attribute-based syntax (e.g., \#\[CoversClass\]) instead of legacy annotations, and the data provider methods are now static. The old \Tests/TimerTest.php\ file was removed and replaced with new tests in the \tests/\ directory that cover the new \Duration\ and \ResourceUsageFormatter\ classes, ensuring correct formatting of time and memory usage, including edge cases where \$\_SERVER\['REQUEST\_TIME\_FLOAT'\]\ is unavailable.

Tests · high confidence

Dependencies

PHPStan static analysis tooling upgraded to version 2.2.16 with strict rules

The local PHP development environment now uses PHPStan 2.2.16, upgraded from previous minor versions, alongside phpstan-strict-rules 2.0.12 and ergebnis/phpstan-rules 2.14.0. This update brings stricter static analysis checks to the codebase, including new rules for named arguments and parameter handling, and ensures compatibility with PHP 8.6. Also in this area: 1 commit (0 fixes) modifying tools, tools/.phpstan/vendor/phpstan/phpstan-phpunit; 4 commits (0 fixes) modifying tools; Updated PHPStan and phpstan-rules to latest versions; Updated phpstan to version 2.2.13.

tools/.phpstan · medium confidence · unverified

Update PHPStan and PHPUnit dependencies to latest versions

The project's \composer.json\ and the isolated PHPStan tooling manifest (\tools/.phpstan/composer.json\) have been updated to use the latest major versions of their development dependencies. Specifically, \phpunit/phpunit\ is now constrained to \^13.3.5\ and \phpstan/phpstan\ to \^2.2.16\, along with their respective extensions (\phpstan-strict-rules\, \ergebnis/phpstan-rules\). This ensures that static analysis and testing run against the most recent tooling versions, which may include new features, bug fixes, or breaking changes in the analysis engine itself.

(dependencies) · high confidence

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 66 → 66 (+0.1)
  • Rubric changed (rubric-2026.10.5 → rubric-2026.11.4) — scores are not directly comparable.

Lenses

  • Code Health 100 → 100 (+0.0)
  • Architecture 69 → 69 (+0.0)
  • Maturity 54 → 54 (+0.0)
  • Readiness 79 → 85 (+5.8)
  • Security 88 → 81 (-6.3)

Findings

  • No change — the same findings as the prior survey.

Changes since last survey

  • 26 commits — 25 feature/other, 1 fixes

By area

  • tools/.phpstan — 15 commits
  • (root) — 5 commits
  • (repo) — 3 commits
  • tests/TimerTest.php — 1 commit
  • tools/.php-cs-fixer — 1 commit
  • tools/composer — 1 commit

Notable commits

  • fix: Fix error reported by PHPStan
  • change: Manage PHP-CS-Fixer with Composer instead of Phive
  • change: Merge branch '8.0'
  • change: Merge branch '8.0'
  • change: Merge branch '8.0'
  • change: Remove stale entry
  • change: Update PHPStan packages
  • change: Update PHPStan packages
  • change: Update dependency ergebnis/phpstan-rules to ^2.17.0
  • change: Update dependency ergebnis/phpstan-rules to ^2.17.0
  • change: Update dependency ergebnis/phpstan-rules to ^2.17.1
  • change: Update dependency ergebnis/phpstan-rules to ^2.17.1
  • change: Update dependency phpstan/phpstan to ^2.3.3
  • change: Update dependency phpstan/phpstan to ^2.3.3
  • change: Update dependency phpstan/phpstan to ^2.3.5
  • change: Update dependency phpstan/phpstan to ^2.3.5
  • change: Update dependency phpstan/phpstan-phpunit to ^2.1.2
  • change: Update dependency phpstan/phpstan-strict-rules to ^2.1.1
  • change: Update dependency phpstan/phpstan-strict-rules to ^2.1.1
  • change: Update dependency phpunit/phpunit to ^12.5.42
  • …and 6 more

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

sebastianbergmann/php-timer was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 13 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 1a50716abf9a48a98acf87b91fa27b66ec87b78a — the exact code this score is about.
  • Scored under rubric-2026.11.4 — the same rubric and the same method as every other entry in this index.
  • Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.65+preprod-859b6d22580d.