Passed
Pull Request — master (#63)
by Eugene
03:00
created
src/Middleware/RetryMiddleware.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -42,28 +42,28 @@
 block discarded – undo
42 42
 
43 43
     public static function constant(int $maxRetries = self::DEFAULT_MAX_RETRIES, int $intervalMs = 100) : self
44 44
     {
45
-        return new self(static function (int $retries) use ($maxRetries, $intervalMs) {
45
+        return new self(static function(int $retries) use ($maxRetries, $intervalMs) {
46 46
             return $retries > $maxRetries ? null : $intervalMs;
47 47
         });
48 48
     }
49 49
 
50 50
     public static function exponential(int $maxRetries = self::DEFAULT_MAX_RETRIES, int $baseMs = 100) : self
51 51
     {
52
-        return new self(static function (int $retries) use ($maxRetries, $baseMs) {
52
+        return new self(static function(int $retries) use ($maxRetries, $baseMs) {
53 53
             return $retries > $maxRetries ? null : $baseMs ** $retries;
54 54
         });
55 55
     }
56 56
 
57 57
     public static function linear(int $maxRetries = self::DEFAULT_MAX_RETRIES, int $differenceMs = 100) : self
58 58
     {
59
-        return new self(static function (int $retries) use ($maxRetries, $differenceMs) {
59
+        return new self(static function(int $retries) use ($maxRetries, $differenceMs) {
60 60
             return $retries > $maxRetries ? null : $differenceMs * $retries;
61 61
         });
62 62
     }
63 63
 
64 64
     public static function custom(\Closure $getDelayMs) : self
65 65
     {
66
-        return new self(static function (int $retries, \Throwable $e) use ($getDelayMs) : ?int {
66
+        return new self(static function(int $retries, \Throwable $e) use ($getDelayMs) : ?int {
67 67
             return $getDelayMs($retries, $e);
68 68
         });
69 69
     }
Please login to merge, or discard this patch.
tests/Unit/Middleware/RetryMiddlewareTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
                 $response
51 51
             ));
52 52
 
53
-        $middleware = RetryMiddleware::custom(static function (int $retries) : ?int {
53
+        $middleware = RetryMiddleware::custom(static function(int $retries) : ?int {
54 54
             return 0;
55 55
         });
56 56
 
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
         $this->handler->expects($this->exactly(4))->method('handle')
63 63
             ->willThrowException(new ConnectionFailed());
64 64
 
65
-        $middleware = RetryMiddleware::custom(static function (int $retries) : ?int {
65
+        $middleware = RetryMiddleware::custom(static function(int $retries) : ?int {
66 66
             return $retries <= 3 ? 0 : null;
67 67
         });
68 68
 
Please login to merge, or discard this patch.
tests/Unit/Handler/MiddlewareHandlerTest.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
         /** @var Middleware $middleware1 */
47 47
         $middleware1 = $this->createMock(Middleware::class);
48 48
         $middleware1->expects($this->once())->method('process')->willReturnCallback(
49
-            static function (Request $request, Handler $handler) use (&$trace) {
49
+            static function(Request $request, Handler $handler) use (&$trace) {
50 50
                 $trace[] = 1;
51 51
 
52 52
                 return $handler->handle($request);
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
         /** @var Middleware $middleware2 */
57 57
         $middleware2 = $this->createMock(Middleware::class);
58 58
         $middleware2->expects($this->once())->method('process')->willReturnCallback(
59
-            static function (Request $request, Handler $handler) use (&$trace) {
59
+            static function(Request $request, Handler $handler) use (&$trace) {
60 60
                 $trace[] = 2;
61 61
 
62 62
                 return $handler->handle($request);
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 
74 74
     public function testMiddlewareRemainsAfterExecution() : void
75 75
     {
76
-        $middlewareCallback = static function (Request $request, Handler $handler) {
76
+        $middlewareCallback = static function(Request $request, Handler $handler) {
77 77
             return $handler->handle($request);
78 78
         };
79 79
 
Please login to merge, or discard this patch.
tests/Integration/MessagePack/MessagePackTest.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -78,10 +78,10 @@  discard block
 block discarded – undo
78 78
     public function testCustomType() : void
79 79
     {
80 80
         $client = ClientBuilder::createFromEnv()
81
-            ->setPackerPureFactory(static function () {
81
+            ->setPackerPureFactory(static function() {
82 82
                 return PurePacker::fromExtensions(new DateTimeExtension(42));
83 83
             })
84
-            ->setPackerPeclFactory(static function () {
84
+            ->setPackerPeclFactory(static function() {
85 85
                 return new PeclPacker(true);
86 86
             })
87 87
             ->build();
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
     public function testDecimalType(string $decimalString) : void
112 112
     {
113 113
         $client = ClientBuilder::createFromEnv()
114
-            ->setPackerPureFactory(static function () {
114
+            ->setPackerPureFactory(static function() {
115 115
                 return PurePacker::fromExtensions(new DecimalExtension());
116 116
             })
117 117
             ->build();
Please login to merge, or discard this patch.