Skip to content

Commit b70c6c2

Browse files
authored
refactor: add strict types to tests (#9953)
1 parent e107e3c commit b70c6c2

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

.php-cs-fixer.tests.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
]);
3131

3232
$overrides = [
33+
'declare_strict_types' => true,
3334
'phpdoc_to_return_type' => true,
3435
'void_return' => true,
3536
];

tests/_support/Commands/Foobar.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
/**
46
* This file is part of CodeIgniter 4 framework.
57
*

utils/src/PhpCsFixer/CodeIgniterRuleCustomisationPolicy.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ public function getRuleCustomisers(): array
3333
$normalisedStrEndsWith = static fn (string $haystack, string $needle): bool => str_ends_with(str_replace('\\', '/', $haystack), $needle);
3434

3535
return [
36+
'declare_strict_types' => static fn (SplFileInfo $file): bool => ! $normalisedStrEndsWith(
37+
$file->getPathname(),
38+
'/tests/system/Debug/ExceptionsTest.php',
39+
),
3640
'native_function_casing' => static fn (SplFileInfo $file): bool => ! $normalisedStrEndsWith(
3741
$file->getPathname(),
3842
'/tests/system/Database/Live/PreparedQueryTest.php',

0 commit comments

Comments
 (0)