Skip to content
CAI
Software that uses CAICheck a score

sebastianbergmann/php-text-template

75.5

Strong · 17 November 2026

541

lines of production code

PHP

primary language

5

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

Features

Add Template class for string replacement

Introduces a new Template class that loads a template file (or its .dist fallback) and replaces placeholders defined by open and close delimiters with provided values. The class supports setting variables with optional merging and rendering the result to a string or writing it directly to a target file.

src · high confidence

Add custom exception hierarchy for the template package

The \src/exceptions\ directory now contains a dedicated exception hierarchy for the \SebastianBergmann\\Template\ namespace. This includes a new \Exception\ interface that extends PHP's \Throwable\, along with concrete \InvalidArgumentException\ and \RuntimeException\ classes that implement this interface. This structure allows the library to throw and catch its own specific exception types, improving error handling clarity for users of the text template functionality.

src/exceptions · high confidence

Added release notes extraction script

A new PHP script, \build/scripts/extract-release-notes.php\, has been added to the build tooling. This utility allows users to extract specific release notes from the \ChangeLog.md\ file by passing a version tag as an argument, facilitating the automation of release processes.

build · high confidence

Initial release of php-text-template with modern tooling and PEAR removal

This entry introduces the php-text-template library, providing a simple template engine for PHP. The project is now distributed exclusively via Composer, removing legacy PEAR support (package.xml and README.markdown deleted). It includes a comprehensive configuration suite for development and CI: PHP-CS-Fixer for code style, PHPUnit for testing, PHPStan at level 10 for static analysis, and Renovate for automated dependency updates. The library is licensed under the BSD 3-Clause License and includes a Security Policy referencing PHPUnit's policy.

(repo-wide) · high confidence

Removals

Removal of Text\_Template class

The Text\_Template class has been removed from the codebase. This eliminates the simple template engine that previously allowed users to load template files, set variables, and render output via string replacement.

Text · 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

126 commits (0 fixes) modifying tools

A change to existing behaviour in tools — 126 commits, 4 files: “Update tools”; “Dust off”; “Update PHP-CS-Fixer”; and 3 more.

tools · medium confidence · unverified

Test coverage

Added unit tests for the Template class

Added PHPUnit tests for the Template class, covering rendering from template files, merging variables, preventing placeholder replacement in inserted values, and handling missing template files.

tests · high confidence

Dependencies

PHPStan static analysis tooling updated to version 2.2.16

The local PHPStan installation in tools/.phpstan has been updated to version 2.2.16, along with its extensions phpstan-strict-rules (2.0.12) and ergebnis/phpstan-rules (2.14.0). This upgrade brings stricter static analysis rules and improved compatibility with modern PHP versions (up to 8.6), enhancing the detection of potential code issues during development. Also in this area: 1 commit (0 fixes) modifying tools, tools/.phpstan/vendor/phpstan/phpstan-strict-rules; 2 commits (0 fixes) modifying tools, tools/.phpstan/vendor/ergebnis/phpstan-rules; Updated PHPStan to version 2.2.17; Updated PHPStan and strict-rules to 2.3.0 and 2.1.0.

tools/.phpstan · medium confidence · unverified

Update development dependencies to PHPUnit 13.4 and PHPStan 2.2

The project's \composer.json\ now requires \phpunit/phpunit\ version ^13.4.0 for testing, and the PHPStan tooling in \tools/.phpstan/composer.json\ has been updated to use \phpstan/phpstan\ version ^2.2.16 along with its associated extensions (\phpstan-strict-rules\, \ergebnis/phpstan-rules\, and \extension-installer\).

(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 74.9 → 75.5 (+0.6)
  • Rubric changed (rubric-2026.11.2 → rubric-2026.11.4) — scores are not directly comparable.

Lenses

  • Code Health 100.0 → 100.0 (0.0)
  • Architecture 69.0 → 69.0 (0.0)
  • Maturity 77.1 → 77.1 (0.0)
  • Readiness 79.1 → 84.9 (+5.8)
  • Security 81.2 → 81.2 (0.0)

Findings

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

Changes since last survey

  • 13 commits — 13 feature/other, 0 fixes

By area

  • tools/.phpstan — 6 commits
  • (repo) — 3 commits
  • (root) — 2 commits
  • tools/.php-cs-fixer — 1 commit
  • tools/composer — 1 commit

Notable commits

  • change: Manage PHP-CS-Fixer with Composer instead of Phive
  • change: Merge branch '5.0'
  • change: Merge branch '5.0'
  • change: Merge branch '5.0'
  • change: Remove stale entry
  • 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.6
  • change: Update dependency phpstan/phpstan-phpunit to ^2.1.2
  • change: Update dependency phpunit/phpunit to ^13.4.7
  • change: Update tools
  • change: Use phpstan/phpstan-deprecation-rules
  • change: Use phpstan/phpstan-phpunit

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-text-template 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 17 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 ffaab13f164c5f84dbd3675eaa156a46a5962544 — 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.84+preprod-d645ca9bbedd.