diff --git a/.github/workflows/coding_style_checks.yml b/.github/workflows/coding_style_checks.yml index e6b936a..853bf61 100644 --- a/.github/workflows/coding_style_checks.yml +++ b/.github/workflows/coding_style_checks.yml @@ -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 diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 26837db..ccd50bf 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -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); diff --git a/src/swoole/Swoole/Coroutine/MySQL.php b/src/swoole/Swoole/Coroutine/MySQL.php index 726153b..e03763f 100644 --- a/src/swoole/Swoole/Coroutine/MySQL.php +++ b/src/swoole/Swoole/Coroutine/MySQL.php @@ -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) { } diff --git a/src/swoole/functions.php b/src/swoole/functions.php index b270a1f..fd77de9 100644 --- a/src/swoole/functions.php +++ b/src/swoole/functions.php @@ -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 { }