Skip to content

Commit

Permalink
替换socket客户端
Browse files Browse the repository at this point in the history
  • Loading branch information
AuroraYolo committed Jul 2, 2021
1 parent 8347d2f commit 5131d62
Show file tree
Hide file tree
Showing 14 changed files with 4,409 additions and 493 deletions.
107 changes: 107 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
<?php

declare(strict_types=1);

$header = <<<'EOF'
This file is part of Serendipity Job
@license https://github.com/serendipitySwow/Serendipity-job/blob/main/LICENSE
EOF;

return (new PhpCsFixer\Config())
->setRiskyAllowed(true)
->setRules([
'@PSR2' => true,
'@Symfony' => true,
'@DoctrineAnnotation' => true,
'@PhpCsFixer' => true,
'header_comment' => [
'comment_type' => 'PHPDoc',
'header' => $header,
'separate' => 'bottom',
'location' => 'after_open',
],
'array_syntax' => [
'syntax' => 'short',
],
'list_syntax' => [
'syntax' => 'short',
],
'concat_space' => [
'spacing' => 'one',
],
'blank_line_before_statement' => [
'statements' => [
'declare',
'return',
],
],
'blank_line_after_namespace' => true,
'braces' => [
'allow_single_line_closure' => true,
],
'general_phpdoc_annotation_remove' => [
'annotations' => [
'author',
],
],
'ordered_imports' => [
'imports_order' => [
'class',
'function',
'const',
],
'sort_algorithm' => 'alpha',
],
'single_line_comment_style' => [
'comment_types' => [
],
],
'yoda_style' => [
'always_move_variable' => false,
'equal' => false,
'identical' => false,
],
'phpdoc_align' => [
'align' => 'left',
],
'multiline_whitespace_before_semicolons' => [
'strategy' => 'no_multi_line',
],
'constant_case' => [
'case' => 'lower',
],
'operator_linebreak' => [
'only_booleans' => true,
'position' => 'end',
],
'class_attributes_separation' => true,
'combine_consecutive_unsets' => true,
'declare_strict_types' => true,
'linebreak_after_opening_tag' => true,
'lowercase_static_reference' => true,
'no_useless_else' => true,
'no_unused_imports' => true,
'no_unneeded_curly_braces' => false,
'not_operator_with_space' => false,
'not_operator_with_successor_space' => false,
'ordered_class_elements' => false,
'php_unit_strict' => false,
'phpdoc_separation' => false,
'phpdoc_summary' => false,
'single_quote' => true,
'increment_style' => false,
'standardize_increment' => false,
'standardize_not_equals' => true,
'multiline_comment_opening_closing' => true,
// NOTE: this is for anonymous functions using WaitReference, maybe there's better solution
'lambda_not_used_import' => false,
])
->setFinder(
PhpCsFixer\Finder::create()
->exclude('vendor')
->exclude('.idea')
->exclude('storage')
->exclude('runtimes')
->in(__DIR__)
)
->setUsingCache(false);
7 changes: 7 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
"ext-sockets": "*",
"ext-bcmath": "*"
},
"require-dev": {
"phpunit/phpunit": "^9.5",
"friendsofphp/php-cs-fixer": "^3.0"
},
"autoload": {
"psr-4": {
"SerendipitySwow\\Nsq\\": "src/"
Expand All @@ -33,6 +37,9 @@
"SerendipitySwowTest\\Nsq\\": "tests/"
}
},
"scripts": {
"cs-fix": [ "@php vendor/bin/php-cs-fixer fix" ]
},
"support": {
"pull-request": "https://github.com/SerendipitySwow/nsq-nsq/pulls",
"issues": "https://github.com/SerendipitySwow/nsq-nsq/issues"
Expand Down
Loading

0 comments on commit 5131d62

Please sign in to comment.