Skip to content

Commit

Permalink
coding style fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Demin Yin <[email protected]>
  • Loading branch information
deminy committed Oct 5, 2023
1 parent 738259c commit 14f089d
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 46 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/coding_style_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ jobs:
uses: actions/checkout@v3

- name: Run Coding Style Checks
run: docker run --rm -v "$(pwd):/project" -w /project -i jakzal/phpqa:php8.1 php-cs-fixer fix --dry-run
run: docker run --rm -v "$(pwd):/project" -w /project -i jakzal/phpqa:php8.2 php-cs-fixer fix --dry-run
88 changes: 45 additions & 43 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,49 +5,51 @@
return (new PhpCsFixer\Config())
->setRiskyAllowed(true)
->setRules([
'@DoctrineAnnotation' => true,
'@PhpCsFixer' => true,
'@PSR2' => true,
'@Symfony' => true,
'align_multiline_comment' => ['comment_type' => 'all_multiline'],
'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => ['operators' => ['=' => 'align', '=>' => 'align', ]],
'blank_line_after_namespace' => true,
'blank_line_before_statement' => ['statements' => ['declare']],
'class_attributes_separation' => true,
'concat_space' => ['spacing' => 'one'],
'constant_case' => ['case' => 'lower'],
'combine_consecutive_unsets' => true,
'declare_strict_types' => true,
'general_phpdoc_annotation_remove' => ['annotations' => ['author']],
'header_comment' => ['comment_type' => 'PHPDoc', 'header' => '', 'separate' => 'bottom', 'location' => 'after_open'],
'increment_style' => ['style' => 'post'],
'lambda_not_used_import' => false,
'linebreak_after_opening_tag' => true,
'list_syntax' => ['syntax' => 'short'],
'lowercase_static_reference' => true,
'multiline_comment_opening_closing' => true,
'multiline_whitespace_before_semicolons' => ['strategy' => 'new_line_for_chained_calls'],
'no_unused_imports' => true,
'no_useless_else' => true,
'no_useless_return' => true,
'not_operator_with_space' => false,
'not_operator_with_successor_space' => false,
'php_unit_strict' => false,
'phpdoc_align' => ['align' => 'left'],
'phpdoc_annotation_without_dot' => false,
'phpdoc_no_empty_return' => false,
'phpdoc_types_order' => ['sort_algorithm' => 'none', 'null_adjustment' => 'always_last'],
'phpdoc_separation' => false,
'phpdoc_summary' => false,
'ordered_class_elements' => true,
'ordered_imports' => ['imports_order' => ['class', 'function', 'const'], 'sort_algorithm' => 'alpha'],
'single_line_comment_style' => ['comment_types' => []],
'single_line_comment_spacing' => false,
'single_quote' => true,
'standardize_increment' => false,
'standardize_not_equals' => true,
'yoda_style' => ['always_move_variable' => false, 'equal' => false, 'identical' => false],
'@DoctrineAnnotation' => true,
'@PhpCsFixer' => true,
'@PSR2' => true,
'@Symfony' => true,
'align_multiline_comment' => ['comment_type' => 'all_multiline'],
'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => ['operators' => ['=' => 'align', '=>' => 'align', ]],
'blank_line_after_namespace' => true,
'blank_line_before_statement' => ['statements' => ['declare']],
'class_attributes_separation' => true,
'concat_space' => ['spacing' => 'one'],
'constant_case' => ['case' => 'lower'],
'combine_consecutive_unsets' => true,
'declare_strict_types' => true,
'general_phpdoc_annotation_remove' => ['annotations' => ['author']],
'header_comment' => ['comment_type' => 'PHPDoc', 'header' => '', 'separate' => 'bottom', 'location' => 'after_open'],
'increment_style' => ['style' => 'post'],
'lambda_not_used_import' => false,
'linebreak_after_opening_tag' => true,
'list_syntax' => ['syntax' => 'short'],
'lowercase_static_reference' => true,
'multiline_comment_opening_closing' => true,
'multiline_whitespace_before_semicolons' => ['strategy' => 'new_line_for_chained_calls'],
'no_superfluous_phpdoc_tags' => ['allow_mixed' => true, 'allow_unused_params' => true, 'remove_inheritdoc' => false],
'no_unused_imports' => true,
'no_useless_else' => true,
'no_useless_return' => true,
'not_operator_with_space' => false,
'not_operator_with_successor_space' => false,
'nullable_type_declaration_for_default_null_value' => ['use_nullable_type_declaration' => true],
'php_unit_strict' => false,
'phpdoc_align' => ['align' => 'left'],
'phpdoc_annotation_without_dot' => false,
'phpdoc_no_empty_return' => false,
'phpdoc_types_order' => ['sort_algorithm' => 'none', 'null_adjustment' => 'always_last'],
'phpdoc_separation' => false,
'phpdoc_summary' => false,
'ordered_class_elements' => true,
'ordered_imports' => ['imports_order' => ['class', 'function', 'const'], 'sort_algorithm' => 'alpha'],
'single_line_comment_style' => ['comment_types' => []],
'single_line_comment_spacing' => false,
'single_quote' => true,
'standardize_increment' => false,
'standardize_not_equals' => true,
'yoda_style' => ['always_move_variable' => false, 'equal' => false, 'identical' => false],
])
->setFinder(PhpCsFixer\Finder::create()->exclude(['swoole_library'])->in(__DIR__ . '/src'))
->setUsingCache(false);
2 changes: 1 addition & 1 deletion src/swoole/Swoole/Coroutine/MySQL.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function setDefer($defer = null)
/**
* @return mixed
*/
public function connect(array $server_config = null)
public function connect(?array $server_config = null)
{
}

Expand Down
2 changes: 1 addition & 1 deletion src/swoole/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@ function swoole_native_curl_multi_getcontent(CurlHandle $handle): ?string
* @see curl_multi_info_read()
* @see https://www.php.net/curl_multi_info_read
*/
function swoole_native_curl_multi_info_read(CurlMultiHandle $multi_handle, int &$queued_messages = null): array|false
function swoole_native_curl_multi_info_read(CurlMultiHandle $multi_handle, ?int &$queued_messages = null): array|false
{
}

Expand Down

0 comments on commit 14f089d

Please sign in to comment.