Skip to content

Commit 7914f81

Browse files
authored
Merge pull request #8754 from paulbalandan/modernize-strpos
style: enable modernize_strpos
2 parents 7eeebe2 + acdbc5d commit 7914f81

6 files changed

Lines changed: 14 additions & 4 deletions

File tree

.php-cs-fixer.dist.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@
4040
__DIR__ . '/spark',
4141
]);
4242

43-
$overrides = [];
43+
$overrides = [
44+
// for updating to coding-standard
45+
'modernize_strpos' => true,
46+
];
4447

4548
$options = [
4649
'cacheFile' => 'build/.php-cs-fixer.cache',

.php-cs-fixer.no-header.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@
2929
__DIR__ . '/admin/starter/builds',
3030
]);
3131

32-
$overrides = [];
32+
$overrides = [
33+
// for updating to coding-standard
34+
'modernize_strpos' => true,
35+
];
3336

3437
$options = [
3538
'cacheFile' => 'build/.php-cs-fixer.no-header.cache',

.php-cs-fixer.tests.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535

3636
$overrides = [
3737
'void_return' => true,
38+
// for updating to coding-standard
39+
'modernize_strpos' => true,
3840
];
3941

4042
$options = [

.php-cs-fixer.user-guide.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@
3939
'import_symbols' => false,
4040
'leading_backslash_in_global_namespace' => true,
4141
],
42+
// for updating to coding-standard
43+
'modernize_strpos' => true,
4244
];
4345

4446
$options = [

spark

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
*/
2626

2727
// Refuse to run when called from php-cgi
28-
if (strpos(PHP_SAPI, 'cgi') === 0) {
28+
if (str_starts_with(PHP_SAPI, 'cgi')) {
2929
exit("The cli tool is not supported when running php-cgi. It needs php-cli to function!\n\n");
3030
}
3131

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
22

3-
if (strpos($response->header('content-type'), 'application/json') !== false) {
3+
if (str_contains($response->header('content-type'), 'application/json')) {
44
$body = json_decode($body);
55
}

0 commit comments

Comments
 (0)