From f2a1b1af61cacd9dd3c8346bae52a0e003841164 Mon Sep 17 00:00:00 2001 From: boherm Date: Mon, 6 Nov 2023 12:09:37 +0100 Subject: [PATCH 1/2] Fix config for updated cs fixer version --- .php_cs.dist => .php-cs-fixer.dist.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename .php_cs.dist => .php-cs-fixer.dist.php (93%) diff --git a/.php_cs.dist b/.php-cs-fixer.dist.php similarity index 93% rename from .php_cs.dist rename to .php-cs-fixer.dist.php index da4a82e..a32918a 100644 --- a/.php_cs.dist +++ b/.php-cs-fixer.dist.php @@ -5,7 +5,7 @@ __DIR__.'/tests', ]); -return PhpCsFixer\Config::create() +return (new PhpCsFixer\Config()) ->setRiskyAllowed(true) ->setRules([ '@Symfony' => true, @@ -28,7 +28,7 @@ 'align' => 'left', ], 'protected_to_private' => false, - 'psr4' => false, + 'psr_autoloading' => false, 'self_accessor' => false, 'yoda_style' => false, 'non_printable_character' => true, From def4aae7e98cba93b38176acc752975c8580a457 Mon Sep 17 00:00:00 2001 From: boherm Date: Mon, 6 Nov 2023 12:10:32 +0100 Subject: [PATCH 2/2] Fix repository files after cs-fixer --- src/Client/GuzzleClient.php | 4 ++-- src/State.php | 6 +++--- src/Transition.php | 12 ++++++------ tests/CircuitBreakerWorkflowTest.php | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/Client/GuzzleClient.php b/src/Client/GuzzleClient.php index 118467a..4c7424f 100644 --- a/src/Client/GuzzleClient.php +++ b/src/Client/GuzzleClient.php @@ -43,12 +43,12 @@ class GuzzleClient implements ClientInterface /** * @var string by default, calls are sent using GET method */ - const DEFAULT_METHOD = 'GET'; + public const DEFAULT_METHOD = 'GET'; /** * Supported HTTP methods */ - const SUPPORTED_METHODS = [ + public const SUPPORTED_METHODS = [ 'GET', 'HEAD', 'POST', diff --git a/src/State.php b/src/State.php index affbd22..6e52285 100644 --- a/src/State.php +++ b/src/State.php @@ -37,7 +37,7 @@ final class State * Once opened, a circuit breaker doesn't do any call * to third-party services. Only the alternative call is done. */ - const OPEN_STATE = 'OPEN'; + public const OPEN_STATE = 'OPEN'; /** * After some conditions are valid, the circuit breaker @@ -45,12 +45,12 @@ final class State * the circuit breaker go to CLOSED state. If it's not, the circuit breaker * go to OPEN state. */ - const HALF_OPEN_STATE = 'HALF OPEN'; + public const HALF_OPEN_STATE = 'HALF OPEN'; /** * On the first call of the service, or if the service is valid * the circuit breaker is in CLOSED state. This means that the callable * to evaluate is done and not the alternative call. */ - const CLOSED_STATE = 'CLOSED'; + public const CLOSED_STATE = 'CLOSED'; } diff --git a/src/Transition.php b/src/Transition.php index d5cf4e9..21f8852 100644 --- a/src/Transition.php +++ b/src/Transition.php @@ -36,34 +36,34 @@ final class Transition /** * Happened only once when calling the Circuit Breaker. */ - const INITIATING_TRANSITION = 'INITIATING'; + public const INITIATING_TRANSITION = 'INITIATING'; /** * Happened when we open the Circuit Breaker. * This means once the Circuit Breaker is in failure. */ - const OPENING_TRANSITION = 'OPENING'; + public const OPENING_TRANSITION = 'OPENING'; /** * Happened once the conditions of retry are met * in OPEN state to move to HALF_OPEN state in the * Circuit Breaker. */ - const CHECKING_AVAILABILITY_TRANSITION = 'CHECKING AVAILABILITY'; + public const CHECKING_AVAILABILITY_TRANSITION = 'CHECKING AVAILABILITY'; /** * Happened when we come back to OPEN state * in the Circuit Breaker from the HALF_OPEN state. */ - const REOPENING_TRANSITION = 'REOPENING'; + public const REOPENING_TRANSITION = 'REOPENING'; /** * Happened if the service is available again. */ - const CLOSING_TRANSITION = 'CLOSING'; + public const CLOSING_TRANSITION = 'CLOSING'; /** * Happened on each try to call the service. */ - const TRIAL_TRANSITION = 'TRIAL'; + public const TRIAL_TRANSITION = 'TRIAL'; } diff --git a/tests/CircuitBreakerWorkflowTest.php b/tests/CircuitBreakerWorkflowTest.php index bc1f273..9ec7e1e 100644 --- a/tests/CircuitBreakerWorkflowTest.php +++ b/tests/CircuitBreakerWorkflowTest.php @@ -47,7 +47,7 @@ class CircuitBreakerWorkflowTest extends CircuitBreakerTestCase { - const OPEN_THRESHOLD = 1; + public const OPEN_THRESHOLD = 1; /** * {@inheritdoc}