sebastianbergmann/environment
59.8
Adequate · 19 September 2026
1k
lines of production code
PHP
primary language
1
measurement over time
What this system is
This system is a PHP library focused on providing robust environment detection and development tooling. It exposes specialized classes for managing console capabilities, host information, and PHP runtime details, such as code coverage drivers. The project emphasizes modern engineering practices by leveraging PHP 8.4, PHPUnit 13, and PHPStan for strict static analysis and automated dependency management.
Behavioural changes
167 commits (0 fixes) modifying tools
A change to existing behaviour in tools — 167 commits, 4 files.
tools · medium confidence · unverified
Automated release note extraction for tagged releases
A new build script, extract-release-notes.php, has been added to the build directory. This tool automates the extraction of release notes from the ChangeLog.md file when a specific version tag is provided, facilitating the creation of release artifacts by isolating the relevant changelog entries for that version.
build · high confidence
Modernized build automation and development tooling
The project has replaced Travis CI with GitHub Actions and updated its build infrastructure to manage Composer and PHP-CS-Fixer via Phive in the \tools/\ directory. Configuration files have been standardized: \phpunit.xml.dist\ is replaced by \phpunit.xml\ with stricter test execution settings, and static analysis has switched from Psalm to PHPStan (configured in \phpstan.neon\). Additionally, Renovate is now configured for automated dependency updates, and archive exports are controlled via \.gitattributes\ to exclude development artifacts.
(repo-wide) · high confidence
Refactor environment detection into dedicated Console, Host, and Runtime classes
The monolithic Environment class has been removed and replaced with specialized classes: Console handles terminal capabilities (color support, interactivity, column width), Host provides system information (hostname, user, OS), and Runtime manages PHP runtime details (code coverage drivers, OPcache settings, binary paths). This change improves modularity and clarifies the responsibilities of each component, while also adding support for PCOV and PHPDBG code coverage detection in the Runtime class.
src · high confidence
Test coverage
Added tests for Console and Runtime classes
Added new test suites for the Console and Runtime classes, replacing the legacy EnvironmentTest. The new ConsoleTest verifies interactive detection for pipe and regular file resources, and ensures getNumberOfColumns does not produce stderr warnings in non-TTY environments. The RuntimeTest covers code-coverage detection (Xdebug, PCOV, PHPDBG), runtime identification, and PHP settings retrieval, utilizing PHPUnit attributes instead of annotations.
tests · high confidence
Dependencies
PHPStan static analysis tooling updated to version 2.2.14
The local PHPStan installation in tools/.phpstan has been updated to version 2.2.14, along with its extensions phpstan-strict-rules (2.0.12) and ergebnis/phpstan-rules (2.13.1). This upgrade brings stricter static analysis rules and improved type coverage for the codebase.
tools/.phpstan · high confidence
Upgrade to PHP 8.4 and PHPUnit 13, add PHPStan tooling
The project now requires PHP 8.4 (dropping support for older versions) and upgrades the development dependency on PHPUnit to version 13.3.4. Additionally, a dedicated PHPStan tooling environment has been introduced under tools/.phpstan, installing PHPStan 2.2.14 along with strict rules and extension installer packages to enhance static analysis capabilities. The main composer.json also includes a suggestion for the ext/posix extension and updates the homepage URL to HTTPS.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Baseline
- First survey — no prior run to compare against. CAI 60.
Lenses
- Code Health 99
- Architecture 69
- Maturity 41
- Readiness 78
- Security 88
Changes since last survey
- 300 commits — 289 feature/other, 11 fixes
By area
- (root) — 87 commits
- .github/workflows — 48 commits
- .phive/phars.xml — 47 commits
- tools/.phpstan — 43 commits
- (repo) — 36 commits
- src/Runtime.php — 17 commits
- src/Console.php — 10 commits
- tests/RuntimeTest.php — 4 commits
- .github/FUNDING.yml — 2 commits
- .psalm/baseline.xml — 2 commits
- .github/CODE_OF_CONDUCT.md — 1 commit
- .github/CONTRIBUTING.md — 1 commit
- .psalm/config.xml — 1 commit
- tests/ConsoleTest.php — 1 commit
Notable commits
- fix: Fix
- fix: Fix CS/WS issue
- fix: Fix CS/WS issues
- fix: Fix CS/WS issues
- fix: Fix Runtime::getCurrentSettings() to detect empty/"off" overrides and compare against compiled-in defaults
- fix: Fix code coverage metadata
- fix: Fix issues identified by PHPStan
- fix: Fix jit
- fix: Fix package name
- fix: Fix type error
- fix: fix second stty call in Console::getNumberOfColumnsInteractive
- change: * Install PHPStan using Composer in order to be able to use phpstan/phpstan-strict-rules and tomasvotruba/type-coverage * Configure phpstan/phpstan-strict-rules, tomasvotruba/type-coverage, and ergebnis/phpstan-rules * Update PHPStan configuration * Put Phive binary under version control and manage it through "ant update-tools"
- change: Add Liberapay and Tidelift
- change: Add documentation on how to contribute
- change: Add link to security policy
- change: Add thanks.dev
- change: Add validation to opcache.jit_buffer_size
- change: Added Runtime->getRawBinary()
- change: Added test
- change: Allow write operations
- …and 280 more
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
sebastianbergmann/environment 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 19 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 627b083b89c8ecdb43d2bd3ce8179b81fa4eb766 — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-13a154b7f5d1.