Skip to content

Commit

Permalink
Update php-cs-fixer rules.
Browse files Browse the repository at this point in the history
  • Loading branch information
demiankatz committed Sep 14, 2023
1 parent b16618d commit 16914ff
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/VuFindHttp/HttpService.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ public function get(
) {
if ($params) {
$query = $this->createQueryString($params);
if (strpos($url, '?') !== false) {
if (str_contains($url, '?')) {
$url .= '&' . $query;
} else {
$url .= '?' . $query;
Expand Down
2 changes: 1 addition & 1 deletion tests/unit-tests/src/VuFindTest/HttpServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public function testGetAppendsHeaders()
'http://example.tld',
['foo=bar'],
'test',
["Content-type: application/json", "Accept: application/json"]
['Content-type: application/json', 'Accept: application/json']
);
}

Expand Down
11 changes: 9 additions & 2 deletions tests/vufind.php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
->in(__DIR__ . '/../src');

$rules = [
'@PHP74Migration' => true,
'@PHP80Migration' => true,
'@PHPUnit84Migration:risky' => true,
'@PSR12' => true,
'align_multiline_comment' => true,
Expand All @@ -17,7 +17,7 @@
'class_attributes_separation' => ['elements' => ['method' => 'one', 'property' => 'one']],
'concat_space' => ['spacing' => 'one'],
'ereg_to_preg' => true,
'function_typehint_space' => true,
'get_class_to_class_keyword' => true,
'global_namespace_import' => [
'import_functions' => true,
'import_classes' => null,
Expand All @@ -26,11 +26,13 @@
'linebreak_after_opening_tag' => true,
'lowercase_cast' => true,
'magic_constant_casing' => true,
'modernize_strpos' => true,
'native_function_casing' => true,
'native_function_invocation' => [
'strict' => true,
'scope' => 'namespaced',
],
'no_alias_functions' => true,
'no_blank_lines_after_class_opening' => true,
'no_empty_comment' => true,
'no_empty_phpdoc' => true,
Expand All @@ -39,10 +41,13 @@
'no_leading_import_slash' => true,
'no_leading_namespace_whitespace' => true,
'no_mixed_echo_print' => true,
'no_php4_constructor' => true,
'no_singleline_whitespace_before_semicolons' => true,
'no_spaces_around_offset' => true,
'no_unneeded_control_parentheses' => true,
'no_unneeded_curly_braces' => true,
'no_unneeded_final_method' => true,
'no_unreachable_default_argument_value' => true,
'no_unused_imports' => true,
'no_useless_return' => true,
'no_whitespace_in_blank_line' => true,
Expand All @@ -55,8 +60,10 @@
'php_unit_method_casing' => true,
'pow_to_exponentiation' => true,
'single_line_after_imports' => true,
'single_quote' => true,
'standardize_not_equals' => true,
'ternary_operator_spaces' => true,
'type_declaration_spaces' => true,
];

$cacheDir = __DIR__ . '/../.php_cs_cache';
Expand Down

0 comments on commit 16914ff

Please sign in to comment.