Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cs-fixer for CI #46

Merged
merged 2 commits into from
Nov 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .php_cs.dist → .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
__DIR__.'/tests',
]);

return PhpCsFixer\Config::create()
return (new PhpCsFixer\Config())
->setRiskyAllowed(true)
->setRules([
'@Symfony' => true,
Expand All @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/Client/GuzzleClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
6 changes: 3 additions & 3 deletions src/State.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,20 @@ 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
* try to access the third-party service. If the service is valid,
* 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';
}
12 changes: 6 additions & 6 deletions src/Transition.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}
2 changes: 1 addition & 1 deletion tests/CircuitBreakerWorkflowTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@

class CircuitBreakerWorkflowTest extends CircuitBreakerTestCase
{
const OPEN_THRESHOLD = 1;
public const OPEN_THRESHOLD = 1;

/**
* {@inheritdoc}
Expand Down
Loading