Skip to content

Commit a1ad3b6

Browse files
committed
Restore strict_types enforcement in php-cs-fixer config
php-cs-fixer v3.95.0 added a `strategy` option to `declare_strict_types` and set `@Symfony:risky` to `'strategy' => 'remove'` (see PHP-CS-Fixer/PHP-CS-Fixer#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.
1 parent fa3cb93 commit a1ad3b6

3 files changed

Lines changed: 5 additions & 0 deletions

File tree

.php-cs-fixer.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
'array_syntax' => ['syntax' => 'short'],
1616
'combine_consecutive_unsets' => true,
1717
'concat_space' => [ 'spacing' => 'one'],
18+
'declare_strict_types' => ['strategy' => 'enforce'],
1819
'explicit_string_variable' => false,
1920
'fopen_flags' => ['b_mode' => true],
2021
'heredoc_to_nowdoc' => true,

dev-bin/phar-test.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#!/usr/bin/env php
22
<?php
33

4+
declare(strict_types=1);
5+
46
require_once 'geoip2.phar';
57
use GeoIp2\Database\Reader;
68

examples/benchmark.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
require __DIR__ . '/../vendor/autoload.php';
46

57
use GeoIp2\Database\Reader;

0 commit comments

Comments
 (0)