From 33a0b04dbeaf4d7b0cb58cf1528c6c028267ea41 Mon Sep 17 00:00:00 2001 From: Gregory Oschwald Date: Tue, 21 Apr 2026 18:41:38 +0000 Subject: [PATCH] Restore strict_types enforcement in php-cs-fixer config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit php-cs-fixer v3.95.0 added a `strategy` option to `declare_strict_types` and set `@Symfony:risky` to `'strategy' => 'remove'` (see https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/pull/9384), which causes the preset we inherit to strip `declare(strict_types=1);` from every file on the next CI run. Override with `'strategy' => 'enforce'` to keep the pre-v3.95 behavior — strict types stay declared. The two example/dev-tool files that didn't already have the declaration had it added by the fixer; neither is part of the library's public API. Closes STF-223. --- .php-cs-fixer.php | 1 + dev-bin/phar-test.php | 2 ++ examples/benchmark.php | 2 ++ 3 files changed, 5 insertions(+) diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php index b9508107..edf01645 100644 --- a/.php-cs-fixer.php +++ b/.php-cs-fixer.php @@ -15,6 +15,7 @@ 'array_syntax' => ['syntax' => 'short'], 'combine_consecutive_unsets' => true, 'concat_space' => [ 'spacing' => 'one'], + 'declare_strict_types' => true, 'explicit_string_variable' => false, 'fopen_flags' => ['b_mode' => true], 'heredoc_to_nowdoc' => true, diff --git a/dev-bin/phar-test.php b/dev-bin/phar-test.php index a355ecd2..9c2aab37 100755 --- a/dev-bin/phar-test.php +++ b/dev-bin/phar-test.php @@ -1,6 +1,8 @@ #!/usr/bin/env php