1
0
mirror of https://github.com/guzzle/guzzle.git synced 2025-01-16 21:08:13 +01:00

Upgrade PHP-CS-Fixer to 3.x (#2937)

This commit is contained in:
Fabien Villepinte 2021-10-05 17:50:51 +02:00 committed by GitHub
parent e38c668f3b
commit 6b499cc5e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 17 additions and 18 deletions

2
.gitattributes vendored
View File

@ -2,7 +2,7 @@
.gitattributes export-ignore
/.github/ export-ignore
.gitignore export-ignore
.php_cs.dist export-ignore
.php-cs-fixer.dist.php export-ignore
/docs/ export-ignore
/Dockerfile export-ignore
/Makefile export-ignore

View File

@ -53,7 +53,7 @@ jobs:
run: composer bin php-cs-fixer update --no-interaction --no-progress
- name: Execute PHP CS Fixer
run: vendor/bin/php-cs-fixer fix --diff-format udiff --dry-run
run: vendor/bin/php-cs-fixer fix --diff --dry-run
psalm:
name: Psalm

4
.gitignore vendored
View File

@ -1,5 +1,5 @@
.php_cs
.php_cs.cache
.php-cs-fixer.php
.php-cs-fixer.cache
.phpunit.result.cache
composer.lock
vendor/

View File

@ -1,24 +1,22 @@
<?php
$config = PhpCsFixer\Config::create()
$config = (new PhpCsFixer\Config())
->setRiskyAllowed(true)
->setRules([
'@PSR2' => true,
'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => ['operators' => ['=>' => null]],
'blank_line_after_opening_tag' => true,
'class_attributes_separation' => ['elements' => ['method']],
'class_attributes_separation' => ['elements' => ['method' => 'one']],
'compact_nullable_typehint' => true,
'concat_space' => ['spacing' => 'one'],
'declare_equal_normalize' => ['space' => 'none'],
'declare_strict_types' => false,
'dir_constant' => true,
'final_static_access' => true,
'fully_qualified_strict_types' => true,
'function_to_constant' => true,
'function_typehint_space' => true,
'header_comment' => false,
'is_null' => ['use_yoda_style' => false],
'list_syntax' => ['syntax' => 'short'],
'lowercase_cast' => true,
'magic_method_casing' => true,
@ -66,6 +64,7 @@ $config = PhpCsFixer\Config::create()
'phpdoc_types_order' => ['null_adjustment' => 'always_last', 'sort_algorithm' => 'none'],
'phpdoc_var_without_name' => true,
'return_assignment' => true,
'self_static_accessor' => true,
'short_scalar_cast' => true,
'single_trait_insert_per_statement' => true,
'standardize_not_equals' => true,

View File

@ -77,7 +77,7 @@ static-phpstan-update-baseline:
static-codestyle-fix:
composer install
composer bin php-cs-fixer update
vendor/bin/php-cs-fixer fix --diff-format udiff $(CS_PARAMS)
vendor/bin/php-cs-fixer fix --diff $(CS_PARAMS)
static-codestyle-check:
$(MAKE) static-codestyle-fix CS_PARAMS="--dry-run"

View File

@ -16,7 +16,7 @@ interface ClientInterface
/**
* The Guzzle major version.
*/
const MAJOR_VERSION = 7;
public const MAJOR_VERSION = 7;
/**
* Send an HTTP request.

View File

@ -15,7 +15,7 @@ use Psr\Http\Message\ResponseInterface;
class HandlerStack
{
/**
* @var null|callable(RequestInterface, array): PromiseInterface
* @var (callable(RequestInterface, array): PromiseInterface)|null
*/
private $handler;
@ -25,7 +25,7 @@ class HandlerStack
private $stack = [];
/**
* @var null|callable(RequestInterface, array): PromiseInterface
* @var (callable(RequestInterface, array): PromiseInterface)|null
*/
private $cached;
@ -40,7 +40,7 @@ class HandlerStack
* The returned handler stack can be passed to a client in the "handler"
* option.
*
* @param null|callable(RequestInterface, array): PromiseInterface $handler HTTP handler function to use with the stack. If no
* @param (callable(RequestInterface, array): PromiseInterface)|null $handler HTTP handler function to use with the stack. If no
* handler is provided, the best handler for your
* system will be utilized.
*/
@ -56,7 +56,7 @@ class HandlerStack
}
/**
* @param null|callable(RequestInterface, array): PromiseInterface $handler Underlying HTTP handler.
* @param (callable(RequestInterface, array): PromiseInterface)|null $handler Underlying HTTP handler.
*/
public function __construct(callable $handler = null)
{

View File

@ -36,7 +36,7 @@ class RetryMiddleware
* returns true if the request is to be
* retried.
* @param callable(RequestInterface, array): PromiseInterface $nextHandler Next handler to invoke.
* @param null|callable(int): int $delay Function that accepts the number of retries
* @param (callable(int): int)|null $delay Function that accepts the number of retries
* and returns the number of
* milliseconds to delay.
*/

View File

@ -1,7 +1,7 @@
{
"require": {
"php": "^7.2.5 || ^8.0",
"friendsofphp/php-cs-fixer": "2.18.3"
"friendsofphp/php-cs-fixer": "3.2.1"
},
"config": {
"preferred-install": "dist"