style: enable modernize_strpos

This commit is contained in:
John Paul E. Balandan, CPA 2024-04-11 00:33:34 +08:00
parent 6a65664e10
commit acdbc5dd0f
No known key found for this signature in database
GPG Key ID: 697D84680E3738DA
6 changed files with 14 additions and 4 deletions

View File

@ -40,7 +40,10 @@ $finder = Finder::create()
__DIR__ . '/spark',
]);
$overrides = [];
$overrides = [
// for updating to coding-standard
'modernize_strpos' => true,
];
$options = [
'cacheFile' => 'build/.php-cs-fixer.cache',

View File

@ -29,7 +29,10 @@ $finder = Finder::create()
__DIR__ . '/admin/starter/builds',
]);
$overrides = [];
$overrides = [
// for updating to coding-standard
'modernize_strpos' => true,
];
$options = [
'cacheFile' => 'build/.php-cs-fixer.no-header.cache',

View File

@ -35,6 +35,8 @@ $finder = Finder::create()
$overrides = [
'void_return' => true,
// for updating to coding-standard
'modernize_strpos' => true,
];
$options = [

View File

@ -39,6 +39,8 @@ $overrides = [
'import_symbols' => false,
'leading_backslash_in_global_namespace' => true,
],
// for updating to coding-standard
'modernize_strpos' => true,
];
$options = [

2
spark
View File

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

View File

@ -1,5 +1,5 @@
<?php
if (strpos($response->header('content-type'), 'application/json') !== false) {
if (str_contains($response->header('content-type'), 'application/json')) {
$body = json_decode($body);
}