Skip to content

fix: PHP 8.4 PHPUnit green after strict_types corpus curation - #1

Draft
ecartz wants to merge 2 commits into
remote-test-2026-08-31from
cursor/php84-phpunit-green-d063
Draft

fix: PHP 8.4 PHPUnit green after strict_types corpus curation#1
ecartz wants to merge 2 commits into
remote-test-2026-08-31from
cursor/php84-phpunit-green-d063

Conversation

@ecartz

@ecartz ecartz commented Aug 31, 2026

Copy link
Copy Markdown

Description

The Rector/PHP-CS-Fixer corpus curation on remote-test-2026-08-31 added declare(strict_types=1) broadly, which broke runtime type coercion in several framework entry points and test fixtures. This PR restores PHP 8.4 compatibility so vendor/bin/phpunit exits 0.

Changes:

  • Remove strict_types from files that intentionally coerce dynamic values (BaseConfig, Parser, Filters, CodeIgniter, ControllerTestTrait, test autorouting controller)
  • Cast env/CLI values where PHP 8.4 now enforces scalar types (BaseConfig::initEnvValue, CLI error backtrace numbering)
  • Restore unsorted imports in tests/_support/Commands/Foobar.php so sort-imports publish tests behave as intended
  • Allow class unserialization in FileHandler for FactoriesCache config caching
  • Update deprecation logging test to avoid str_contains(null) TypeError under strict test files
  • Flush Redis in PredisHandlerTest::setUp() to isolate key-count assertions

Verification

composer install --no-interaction
vendor/bin/phpunit
  • Exit code: 0
  • Tests: 7770
  • Assertions: 18969
  • Skipped: 121
  • Runtime: ~63s
  • Coverage log: build/logs/clover.xml
  • Coverage text: build/coverage/coverage.txt

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value (without duplication)
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide
Open in Web Open in Cursor 

cursoragent and others added 2 commits August 31, 2026 03:52
Remove declare(strict_types=1) from files that perform dynamic type coercion
(BaseConfig, Parser, Filters, CodeIgniter, ControllerTestTrait). Cast env
values and CLI backtrace indices for PHP 8.4 type safety. Restore unsorted
imports in Foobar test fixture so sortImports tests work. Allow class
unserialization in FileHandler for FactoriesCache. Update deprecation test
to avoid strict_types TypeError on str_contains(null).

Co-authored-by: ecartz <ecartz@users.noreply.github.com>
Co-authored-by: ecartz <ecartz@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants