From 55480ab2c0177e71af13596890afd31462c5be99 Mon Sep 17 00:00:00 2001 From: Konstantin Grachev Date: Thu, 17 Jun 2021 16:21:26 +0300 Subject: [PATCH] Bump friendsofphp/php-cs-fixer up to 3.0 --- .gitignore | 2 +- .php-cs-fixer.php | 44 +++++++++++++++++++++++++++++++++++++ .php_cs.dist | 28 ----------------------- composer.json | 2 +- src/Stream/SocketStream.php | 2 +- 5 files changed, 47 insertions(+), 31 deletions(-) create mode 100644 .php-cs-fixer.php delete mode 100644 .php_cs.dist diff --git a/.gitignore b/.gitignore index 6b59151..378fe3f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ /vendor/ /composer.lock -/.php_cs.cache +/.php-cs-fixer.cache /.phpunit.result.cache /infection.log diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php new file mode 100644 index 0000000..dcd2b47 --- /dev/null +++ b/.php-cs-fixer.php @@ -0,0 +1,44 @@ +in(__DIR__) + ->exclude('vendor'); + +return (new PhpCsFixer\Config()) + ->setRiskyAllowed(true) + ->setRules([ + '@PhpCsFixer' => true, + '@PhpCsFixer:risky' => true, + '@PSR12' => true, + '@PSR12:risky' => true, + 'blank_line_before_statement' => [ + 'statements' => [ + 'continue', + 'do', + 'exit', + 'goto', + 'if', + 'return', + 'switch', + 'throw', + 'try', + ], + ], + 'declare_strict_types' => true, + 'global_namespace_import' => [ + 'import_classes' => false, + 'import_constants' => false, + 'import_functions' => false, + ], + 'php_unit_internal_class' => false, + 'php_unit_test_case_static_method_calls' => ['call_type' => 'self'], + 'php_unit_test_class_requires_covers' => false, + 'phpdoc_to_comment' => false, + 'yoda_style' => true, + 'trailing_comma_in_multiline' => [ + 'after_heredoc' => true, + 'elements' => ['arrays', 'arguments', 'parameters'], + ], + ]) + ->setFinder($finder) + ->setCacheFile(__DIR__.'/.php-cs-fixer.cache'); diff --git a/.php_cs.dist b/.php_cs.dist deleted file mode 100644 index 7730898..0000000 --- a/.php_cs.dist +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env php -setRiskyAllowed(true) - ->setRules([ - '@PhpCsFixer' => true, - '@PhpCsFixer:risky' => true, - '@PSR12' => true, - '@PSR12:risky' => true, - 'braces' => [ - 'allow_single_line_closure' => true, - ], - 'blank_line_before_statement' => [ - 'statements' => ['continue', 'do', 'die', 'exit', 'goto', 'if', 'return', 'switch', 'throw', 'try'], - ], - 'declare_strict_types' => true, - 'global_namespace_import' => ['import_classes' => false, 'import_constants' => false, 'import_functions' => false], - 'php_unit_internal_class' => false, - 'php_unit_test_case_static_method_calls'=> ['call_type' => 'self'], - 'php_unit_test_class_requires_covers' => false, - 'phpdoc_to_comment' => false, - 'yoda_style' => true, - ]) - ->setFinder( - PhpCsFixer\Finder::create() - ->in(__DIR__) - ); diff --git a/composer.json b/composer.json index f31a1b3..3cee6e6 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ "amphp/log": "^1.1", "dg/bypass-finals": "^1.3", "ergebnis/composer-normalize": "9999999-dev", - "friendsofphp/php-cs-fixer": "^2.18", + "friendsofphp/php-cs-fixer": "^3.0", "infection/infection": "^0.23.0", "nyholm/nsa": "^1.2", "phpstan/phpstan": "^0.12.68", diff --git a/src/Stream/SocketStream.php b/src/Stream/SocketStream.php index 4fd87e6..10307f7 100644 --- a/src/Stream/SocketStream.php +++ b/src/Stream/SocketStream.php @@ -40,7 +40,7 @@ class SocketStream implements Stream $context = $context->withTlsContext( (new ClientTlsContext('')) - ->withoutPeerVerification() + ->withoutPeerVerification(), ); return new self(yield connect($uri, $context));