Completed
Pull Request — master (#359)
by Maxence
41s
created
lib/Vendor/Http/Discovery/Strategy/MockClientStrategy.php 2 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -13,12 +13,12 @@
 block discarded – undo
13 13
  */
14 14
 final class MockClientStrategy implements DiscoveryStrategy
15 15
 {
16
-    public static function getCandidates($type)
17
-    {
18
-        if (is_a(HttpClient::class, $type, true) || is_a(HttpAsyncClient::class, $type, true)) {
19
-            return [['class' => Mock::class, 'condition' => Mock::class]];
20
-        }
16
+	public static function getCandidates($type)
17
+	{
18
+		if (is_a(HttpClient::class, $type, true) || is_a(HttpAsyncClient::class, $type, true)) {
19
+			return [['class' => Mock::class, 'condition' => Mock::class]];
20
+		}
21 21
 
22
-        return [];
23
-    }
22
+		return [];
23
+	}
24 24
 }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,8 +11,7 @@
 block discarded – undo
11 11
  *
12 12
  * @author Sam Rapaport <[email protected]>
13 13
  */
14
-final class MockClientStrategy implements DiscoveryStrategy
15
-{
14
+final class MockClientStrategy implements DiscoveryStrategy {
16 15
     public static function getCandidates($type)
17 16
     {
18 17
         if (is_a(HttpClient::class, $type, true) || is_a(HttpAsyncClient::class, $type, true)) {
Please login to merge, or discard this patch.
lib/Vendor/Http/Discovery/StreamFactoryDiscovery.php 2 patches
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -14,21 +14,21 @@
 block discarded – undo
14 14
  */
15 15
 final class StreamFactoryDiscovery extends ClassDiscovery
16 16
 {
17
-    /**
18
-     * Finds a Stream Factory.
19
-     *
20
-     * @return StreamFactory
21
-     *
22
-     * @throws Exception\NotFoundException
23
-     */
24
-    public static function find()
25
-    {
26
-        try {
27
-            $streamFactory = static::findOneByType(StreamFactory::class);
28
-        } catch (DiscoveryFailedException $e) {
29
-            throw new NotFoundException('No stream factories found. To use Guzzle, Diactoros or Slim Framework factories install php-http/message and the chosen message implementation.', 0, $e);
30
-        }
17
+	/**
18
+	 * Finds a Stream Factory.
19
+	 *
20
+	 * @return StreamFactory
21
+	 *
22
+	 * @throws Exception\NotFoundException
23
+	 */
24
+	public static function find()
25
+	{
26
+		try {
27
+			$streamFactory = static::findOneByType(StreamFactory::class);
28
+		} catch (DiscoveryFailedException $e) {
29
+			throw new NotFoundException('No stream factories found. To use Guzzle, Diactoros or Slim Framework factories install php-http/message and the chosen message implementation.', 0, $e);
30
+		}
31 31
 
32
-        return static::instantiateClass($streamFactory);
33
-    }
32
+		return static::instantiateClass($streamFactory);
33
+	}
34 34
 }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -12,8 +12,7 @@
 block discarded – undo
12 12
  *
13 13
  * @deprecated This will be removed in 2.0. Consider using Psr17FactoryDiscovery.
14 14
  */
15
-final class StreamFactoryDiscovery extends ClassDiscovery
16
-{
15
+final class StreamFactoryDiscovery extends ClassDiscovery {
17 16
     /**
18 17
      * Finds a Stream Factory.
19 18
      *
Please login to merge, or discard this patch.
lib/Vendor/Http/Discovery/Psr18Client.php 2 patches
Indentation   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -22,24 +22,24 @@
 block discarded – undo
22 22
  */
23 23
 class Psr18Client extends Psr17Factory implements ClientInterface
24 24
 {
25
-    private $client;
25
+	private $client;
26 26
 
27
-    public function __construct(
28
-        ?ClientInterface $client = null,
29
-        ?RequestFactoryInterface $requestFactory = null,
30
-        ?ResponseFactoryInterface $responseFactory = null,
31
-        ?ServerRequestFactoryInterface $serverRequestFactory = null,
32
-        ?StreamFactoryInterface $streamFactory = null,
33
-        ?UploadedFileFactoryInterface $uploadedFileFactory = null,
34
-        ?UriFactoryInterface $uriFactory = null
35
-    ) {
36
-        parent::__construct($requestFactory, $responseFactory, $serverRequestFactory, $streamFactory, $uploadedFileFactory, $uriFactory);
27
+	public function __construct(
28
+		?ClientInterface $client = null,
29
+		?RequestFactoryInterface $requestFactory = null,
30
+		?ResponseFactoryInterface $responseFactory = null,
31
+		?ServerRequestFactoryInterface $serverRequestFactory = null,
32
+		?StreamFactoryInterface $streamFactory = null,
33
+		?UploadedFileFactoryInterface $uploadedFileFactory = null,
34
+		?UriFactoryInterface $uriFactory = null
35
+	) {
36
+		parent::__construct($requestFactory, $responseFactory, $serverRequestFactory, $streamFactory, $uploadedFileFactory, $uriFactory);
37 37
 
38
-        $this->client = $client ?? Psr18ClientDiscovery::find();
39
-    }
38
+		$this->client = $client ?? Psr18ClientDiscovery::find();
39
+	}
40 40
 
41
-    public function sendRequest(RequestInterface $request): ResponseInterface
42
-    {
43
-        return $this->client->sendRequest($request);
44
-    }
41
+	public function sendRequest(RequestInterface $request): ResponseInterface
42
+	{
43
+		return $this->client->sendRequest($request);
44
+	}
45 45
 }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,8 +20,7 @@
 block discarded – undo
20 20
  *
21 21
  * @author Nicolas Grekas <[email protected]>
22 22
  */
23
-class Psr18Client extends Psr17Factory implements ClientInterface
24
-{
23
+class Psr18Client extends Psr17Factory implements ClientInterface {
25 24
     private $client;
26 25
 
27 26
     public function __construct(
Please login to merge, or discard this patch.
lib/Vendor/Http/Discovery/Psr17FactoryDiscovery.php 2 patches
Indentation   +116 added lines, -116 removed lines patch added patch discarded remove patch
@@ -18,120 +18,120 @@
 block discarded – undo
18 18
  */
19 19
 final class Psr17FactoryDiscovery extends ClassDiscovery
20 20
 {
21
-    private static function createException($type, Exception $e)
22
-    {
23
-        return new RealNotFoundException(
24
-            'No PSR-17 '.$type.' found. Install a package from this list: https://packagist.org/providers/psr/http-factory-implementation',
25
-            0,
26
-            $e
27
-        );
28
-    }
29
-
30
-    /**
31
-     * @return RequestFactoryInterface
32
-     *
33
-     * @throws RealNotFoundException
34
-     */
35
-    public static function findRequestFactory()
36
-    {
37
-        try {
38
-            $messageFactory = static::findOneByType(RequestFactoryInterface::class);
39
-        } catch (DiscoveryFailedException $e) {
40
-            throw self::createException('request factory', $e);
41
-        }
42
-
43
-        return static::instantiateClass($messageFactory);
44
-    }
45
-
46
-    /**
47
-     * @return ResponseFactoryInterface
48
-     *
49
-     * @throws RealNotFoundException
50
-     */
51
-    public static function findResponseFactory()
52
-    {
53
-        try {
54
-            $messageFactory = static::findOneByType(ResponseFactoryInterface::class);
55
-        } catch (DiscoveryFailedException $e) {
56
-            throw self::createException('response factory', $e);
57
-        }
58
-
59
-        return static::instantiateClass($messageFactory);
60
-    }
61
-
62
-    /**
63
-     * @return ServerRequestFactoryInterface
64
-     *
65
-     * @throws RealNotFoundException
66
-     */
67
-    public static function findServerRequestFactory()
68
-    {
69
-        try {
70
-            $messageFactory = static::findOneByType(ServerRequestFactoryInterface::class);
71
-        } catch (DiscoveryFailedException $e) {
72
-            throw self::createException('server request factory', $e);
73
-        }
74
-
75
-        return static::instantiateClass($messageFactory);
76
-    }
77
-
78
-    /**
79
-     * @return StreamFactoryInterface
80
-     *
81
-     * @throws RealNotFoundException
82
-     */
83
-    public static function findStreamFactory()
84
-    {
85
-        try {
86
-            $messageFactory = static::findOneByType(StreamFactoryInterface::class);
87
-        } catch (DiscoveryFailedException $e) {
88
-            throw self::createException('stream factory', $e);
89
-        }
90
-
91
-        return static::instantiateClass($messageFactory);
92
-    }
93
-
94
-    /**
95
-     * @return UploadedFileFactoryInterface
96
-     *
97
-     * @throws RealNotFoundException
98
-     */
99
-    public static function findUploadedFileFactory()
100
-    {
101
-        try {
102
-            $messageFactory = static::findOneByType(UploadedFileFactoryInterface::class);
103
-        } catch (DiscoveryFailedException $e) {
104
-            throw self::createException('uploaded file factory', $e);
105
-        }
106
-
107
-        return static::instantiateClass($messageFactory);
108
-    }
109
-
110
-    /**
111
-     * @return UriFactoryInterface
112
-     *
113
-     * @throws RealNotFoundException
114
-     */
115
-    public static function findUriFactory()
116
-    {
117
-        try {
118
-            $messageFactory = static::findOneByType(UriFactoryInterface::class);
119
-        } catch (DiscoveryFailedException $e) {
120
-            throw self::createException('url factory', $e);
121
-        }
122
-
123
-        return static::instantiateClass($messageFactory);
124
-    }
125
-
126
-    /**
127
-     * @return UriFactoryInterface
128
-     *
129
-     * @throws RealNotFoundException
130
-     *
131
-     * @deprecated This will be removed in 2.0. Consider using the findUriFactory() method.
132
-     */
133
-    public static function findUrlFactory()
134
-    {
135
-        return static::findUriFactory();
136
-    }
21
+	private static function createException($type, Exception $e)
22
+	{
23
+		return new RealNotFoundException(
24
+			'No PSR-17 '.$type.' found. Install a package from this list: https://packagist.org/providers/psr/http-factory-implementation',
25
+			0,
26
+			$e
27
+		);
28
+	}
29
+
30
+	/**
31
+	 * @return RequestFactoryInterface
32
+	 *
33
+	 * @throws RealNotFoundException
34
+	 */
35
+	public static function findRequestFactory()
36
+	{
37
+		try {
38
+			$messageFactory = static::findOneByType(RequestFactoryInterface::class);
39
+		} catch (DiscoveryFailedException $e) {
40
+			throw self::createException('request factory', $e);
41
+		}
42
+
43
+		return static::instantiateClass($messageFactory);
44
+	}
45
+
46
+	/**
47
+	 * @return ResponseFactoryInterface
48
+	 *
49
+	 * @throws RealNotFoundException
50
+	 */
51
+	public static function findResponseFactory()
52
+	{
53
+		try {
54
+			$messageFactory = static::findOneByType(ResponseFactoryInterface::class);
55
+		} catch (DiscoveryFailedException $e) {
56
+			throw self::createException('response factory', $e);
57
+		}
58
+
59
+		return static::instantiateClass($messageFactory);
60
+	}
61
+
62
+	/**
63
+	 * @return ServerRequestFactoryInterface
64
+	 *
65
+	 * @throws RealNotFoundException
66
+	 */
67
+	public static function findServerRequestFactory()
68
+	{
69
+		try {
70
+			$messageFactory = static::findOneByType(ServerRequestFactoryInterface::class);
71
+		} catch (DiscoveryFailedException $e) {
72
+			throw self::createException('server request factory', $e);
73
+		}
74
+
75
+		return static::instantiateClass($messageFactory);
76
+	}
77
+
78
+	/**
79
+	 * @return StreamFactoryInterface
80
+	 *
81
+	 * @throws RealNotFoundException
82
+	 */
83
+	public static function findStreamFactory()
84
+	{
85
+		try {
86
+			$messageFactory = static::findOneByType(StreamFactoryInterface::class);
87
+		} catch (DiscoveryFailedException $e) {
88
+			throw self::createException('stream factory', $e);
89
+		}
90
+
91
+		return static::instantiateClass($messageFactory);
92
+	}
93
+
94
+	/**
95
+	 * @return UploadedFileFactoryInterface
96
+	 *
97
+	 * @throws RealNotFoundException
98
+	 */
99
+	public static function findUploadedFileFactory()
100
+	{
101
+		try {
102
+			$messageFactory = static::findOneByType(UploadedFileFactoryInterface::class);
103
+		} catch (DiscoveryFailedException $e) {
104
+			throw self::createException('uploaded file factory', $e);
105
+		}
106
+
107
+		return static::instantiateClass($messageFactory);
108
+	}
109
+
110
+	/**
111
+	 * @return UriFactoryInterface
112
+	 *
113
+	 * @throws RealNotFoundException
114
+	 */
115
+	public static function findUriFactory()
116
+	{
117
+		try {
118
+			$messageFactory = static::findOneByType(UriFactoryInterface::class);
119
+		} catch (DiscoveryFailedException $e) {
120
+			throw self::createException('url factory', $e);
121
+		}
122
+
123
+		return static::instantiateClass($messageFactory);
124
+	}
125
+
126
+	/**
127
+	 * @return UriFactoryInterface
128
+	 *
129
+	 * @throws RealNotFoundException
130
+	 *
131
+	 * @deprecated This will be removed in 2.0. Consider using the findUriFactory() method.
132
+	 */
133
+	public static function findUrlFactory()
134
+	{
135
+		return static::findUriFactory();
136
+	}
137 137
 }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,8 +16,7 @@
 block discarded – undo
16 16
  *
17 17
  * @author Tobias Nyholm <[email protected]>
18 18
  */
19
-final class Psr17FactoryDiscovery extends ClassDiscovery
20
-{
19
+final class Psr17FactoryDiscovery extends ClassDiscovery {
21 20
     private static function createException($type, Exception $e)
22 21
     {
23 22
         return new RealNotFoundException(
Please login to merge, or discard this patch.
lib/Vendor/Http/Discovery/NotFoundException.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,6 +11,5 @@
 block discarded – undo
11 11
  *
12 12
  * @deprecated since since version 1.0, and will be removed in 2.0. Use {@link \OCA\FullTextSearch_Elasticsearch\Vendor\Http\Discovery\Exception\NotFoundException} instead.
13 13
  */
14
-final class NotFoundException extends RealNotFoundException
15
-{
14
+final class NotFoundException extends RealNotFoundException {
16 15
 }
Please login to merge, or discard this patch.
lib/Vendor/Http/Discovery/MessageFactoryDiscovery.php 2 patches
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -14,21 +14,21 @@
 block discarded – undo
14 14
  */
15 15
 final class MessageFactoryDiscovery extends ClassDiscovery
16 16
 {
17
-    /**
18
-     * Finds a Message Factory.
19
-     *
20
-     * @return MessageFactory
21
-     *
22
-     * @throws Exception\NotFoundException
23
-     */
24
-    public static function find()
25
-    {
26
-        try {
27
-            $messageFactory = static::findOneByType(MessageFactory::class);
28
-        } catch (DiscoveryFailedException $e) {
29
-            throw new NotFoundException('No php-http message factories found. Note that the php-http message factories are deprecated in favor of the PSR-17 message factories. To use the legacy Guzzle, Diactoros or Slim Framework factories of php-http, install php-http/message and php-http/message-factory and the chosen message implementation.', 0, $e);
30
-        }
17
+	/**
18
+	 * Finds a Message Factory.
19
+	 *
20
+	 * @return MessageFactory
21
+	 *
22
+	 * @throws Exception\NotFoundException
23
+	 */
24
+	public static function find()
25
+	{
26
+		try {
27
+			$messageFactory = static::findOneByType(MessageFactory::class);
28
+		} catch (DiscoveryFailedException $e) {
29
+			throw new NotFoundException('No php-http message factories found. Note that the php-http message factories are deprecated in favor of the PSR-17 message factories. To use the legacy Guzzle, Diactoros or Slim Framework factories of php-http, install php-http/message and php-http/message-factory and the chosen message implementation.', 0, $e);
30
+		}
31 31
 
32
-        return static::instantiateClass($messageFactory);
33
-    }
32
+		return static::instantiateClass($messageFactory);
33
+	}
34 34
 }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -12,8 +12,7 @@
 block discarded – undo
12 12
  *
13 13
  * @deprecated This will be removed in 2.0. Consider using Psr17FactoryDiscovery.
14 14
  */
15
-final class MessageFactoryDiscovery extends ClassDiscovery
16
-{
15
+final class MessageFactoryDiscovery extends ClassDiscovery {
17 16
     /**
18 17
      * Finds a Message Factory.
19 18
      *
Please login to merge, or discard this patch.
lib/Vendor/Http/Promise/FulfilledPromise.php 2 patches
Indentation   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -9,43 +9,43 @@
 block discarded – undo
9 9
  */
10 10
 final class FulfilledPromise implements Promise
11 11
 {
12
-    /**
13
-     * @var mixed
14
-     */
15
-    private $result;
16
-
17
-    /**
18
-     * @param mixed $result
19
-     */
20
-    public function __construct($result)
21
-    {
22
-        $this->result = $result;
23
-    }
24
-
25
-    public function then(?callable $onFulfilled = null, ?callable $onRejected = null)
26
-    {
27
-        if (null === $onFulfilled) {
28
-            return $this;
29
-        }
30
-
31
-        try {
32
-            return new self($onFulfilled($this->result));
33
-        } catch (\Exception $e) {
34
-            return new RejectedPromise($e);
35
-        }
36
-    }
37
-
38
-    public function getState()
39
-    {
40
-        return Promise::FULFILLED;
41
-    }
42
-
43
-    public function wait($unwrap = true)
44
-    {
45
-        if ($unwrap) {
46
-            return $this->result;
47
-        }
48
-
49
-        return null;
50
-    }
12
+	/**
13
+	 * @var mixed
14
+	 */
15
+	private $result;
16
+
17
+	/**
18
+	 * @param mixed $result
19
+	 */
20
+	public function __construct($result)
21
+	{
22
+		$this->result = $result;
23
+	}
24
+
25
+	public function then(?callable $onFulfilled = null, ?callable $onRejected = null)
26
+	{
27
+		if (null === $onFulfilled) {
28
+			return $this;
29
+		}
30
+
31
+		try {
32
+			return new self($onFulfilled($this->result));
33
+		} catch (\Exception $e) {
34
+			return new RejectedPromise($e);
35
+		}
36
+	}
37
+
38
+	public function getState()
39
+	{
40
+		return Promise::FULFILLED;
41
+	}
42
+
43
+	public function wait($unwrap = true)
44
+	{
45
+		if ($unwrap) {
46
+			return $this->result;
47
+		}
48
+
49
+		return null;
50
+	}
51 51
 }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -7,8 +7,7 @@
 block discarded – undo
7 7
  *
8 8
  * @author Joel Wurtz <[email protected]>
9 9
  */
10
-final class FulfilledPromise implements Promise
11
-{
10
+final class FulfilledPromise implements Promise {
12 11
     /**
13 12
      * @var mixed
14 13
      */
Please login to merge, or discard this patch.
lib/Vendor/Http/Promise/Promise.php 2 patches
Indentation   +46 added lines, -46 removed lines patch added patch discarded remove patch
@@ -15,55 +15,55 @@
 block discarded – undo
15 15
  */
16 16
 interface Promise
17 17
 {
18
-    /**
19
-     * Promise has not been fulfilled or rejected.
20
-     */
21
-    const PENDING = 'pending';
18
+	/**
19
+	 * Promise has not been fulfilled or rejected.
20
+	 */
21
+	const PENDING = 'pending';
22 22
 
23
-    /**
24
-     * Promise has been fulfilled.
25
-     */
26
-    const FULFILLED = 'fulfilled';
23
+	/**
24
+	 * Promise has been fulfilled.
25
+	 */
26
+	const FULFILLED = 'fulfilled';
27 27
 
28
-    /**
29
-     * Promise has been rejected.
30
-     */
31
-    const REJECTED = 'rejected';
28
+	/**
29
+	 * Promise has been rejected.
30
+	 */
31
+	const REJECTED = 'rejected';
32 32
 
33
-    /**
34
-     * Adds behavior for when the promise is resolved or rejected (response will be available, or error happens).
35
-     *
36
-     * If you do not care about one of the cases, you can set the corresponding callable to null
37
-     * The callback will be called when the value arrived and never more than once.
38
-     *
39
-     * @param callable|null $onFulfilled called when a response will be available
40
-     * @param callable|null $onRejected  called when an exception occurs
41
-     *
42
-     * @return Promise a new resolved promise with value of the executed callback (onFulfilled / onRejected)
43
-     */
44
-    public function then(?callable $onFulfilled = null, ?callable $onRejected = null);
33
+	/**
34
+	 * Adds behavior for when the promise is resolved or rejected (response will be available, or error happens).
35
+	 *
36
+	 * If you do not care about one of the cases, you can set the corresponding callable to null
37
+	 * The callback will be called when the value arrived and never more than once.
38
+	 *
39
+	 * @param callable|null $onFulfilled called when a response will be available
40
+	 * @param callable|null $onRejected  called when an exception occurs
41
+	 *
42
+	 * @return Promise a new resolved promise with value of the executed callback (onFulfilled / onRejected)
43
+	 */
44
+	public function then(?callable $onFulfilled = null, ?callable $onRejected = null);
45 45
 
46
-    /**
47
-     * Returns the state of the promise, one of PENDING, FULFILLED or REJECTED.
48
-     *
49
-     * @return string
50
-     */
51
-    public function getState();
46
+	/**
47
+	 * Returns the state of the promise, one of PENDING, FULFILLED or REJECTED.
48
+	 *
49
+	 * @return string
50
+	 */
51
+	public function getState();
52 52
 
53
-    /**
54
-     * Wait for the promise to be fulfilled or rejected.
55
-     *
56
-     * When this method returns, the request has been resolved and if callables have been
57
-     * specified, the appropriate one has terminated.
58
-     *
59
-     * When $unwrap is true (the default), the response is returned, or the exception thrown
60
-     * on failure. Otherwise, nothing is returned or thrown.
61
-     *
62
-     * @param bool $unwrap Whether to return resolved value / throw reason or not
63
-     *
64
-     * @return ($unwrap is true ? mixed : null) Resolved value, null if $unwrap is set to false
65
-     *
66
-     * @throws \Throwable the rejection reason if $unwrap is set to true and the request failed
67
-     */
68
-    public function wait($unwrap = true);
53
+	/**
54
+	 * Wait for the promise to be fulfilled or rejected.
55
+	 *
56
+	 * When this method returns, the request has been resolved and if callables have been
57
+	 * specified, the appropriate one has terminated.
58
+	 *
59
+	 * When $unwrap is true (the default), the response is returned, or the exception thrown
60
+	 * on failure. Otherwise, nothing is returned or thrown.
61
+	 *
62
+	 * @param bool $unwrap Whether to return resolved value / throw reason or not
63
+	 *
64
+	 * @return ($unwrap is true ? mixed : null) Resolved value, null if $unwrap is set to false
65
+	 *
66
+	 * @throws \Throwable the rejection reason if $unwrap is set to true and the request failed
67
+	 */
68
+	public function wait($unwrap = true);
69 69
 }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,8 +13,7 @@
 block discarded – undo
13 13
  * @author Joel Wurtz <[email protected]>
14 14
  * @author Márk Sági-Kazár <[email protected]>
15 15
  */
16
-interface Promise
17
-{
16
+interface Promise {
18 17
     /**
19 18
      * Promise has not been fulfilled or rejected.
20 19
      */
Please login to merge, or discard this patch.
lib/Vendor/Http/Promise/RejectedPromise.php 2 patches
Indentation   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -9,40 +9,40 @@
 block discarded – undo
9 9
  */
10 10
 final class RejectedPromise implements Promise
11 11
 {
12
-    /**
13
-     * @var \Throwable
14
-     */
15
-    private $exception;
16
-
17
-    public function __construct(\Throwable $exception)
18
-    {
19
-        $this->exception = $exception;
20
-    }
21
-
22
-    public function then(?callable $onFulfilled = null, ?callable $onRejected = null)
23
-    {
24
-        if (null === $onRejected) {
25
-            return $this;
26
-        }
27
-
28
-        try {
29
-            return new FulfilledPromise($onRejected($this->exception));
30
-        } catch (\Exception $e) {
31
-            return new self($e);
32
-        }
33
-    }
34
-
35
-    public function getState()
36
-    {
37
-        return Promise::REJECTED;
38
-    }
39
-
40
-    public function wait($unwrap = true)
41
-    {
42
-        if ($unwrap) {
43
-            throw $this->exception;
44
-        }
45
-
46
-        return null;
47
-    }
12
+	/**
13
+	 * @var \Throwable
14
+	 */
15
+	private $exception;
16
+
17
+	public function __construct(\Throwable $exception)
18
+	{
19
+		$this->exception = $exception;
20
+	}
21
+
22
+	public function then(?callable $onFulfilled = null, ?callable $onRejected = null)
23
+	{
24
+		if (null === $onRejected) {
25
+			return $this;
26
+		}
27
+
28
+		try {
29
+			return new FulfilledPromise($onRejected($this->exception));
30
+		} catch (\Exception $e) {
31
+			return new self($e);
32
+		}
33
+	}
34
+
35
+	public function getState()
36
+	{
37
+		return Promise::REJECTED;
38
+	}
39
+
40
+	public function wait($unwrap = true)
41
+	{
42
+		if ($unwrap) {
43
+			throw $this->exception;
44
+		}
45
+
46
+		return null;
47
+	}
48 48
 }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -7,8 +7,7 @@
 block discarded – undo
7 7
  *
8 8
  * @author Joel Wurtz <[email protected]>
9 9
  */
10
-final class RejectedPromise implements Promise
11
-{
10
+final class RejectedPromise implements Promise {
12 11
     /**
13 12
      * @var \Throwable
14 13
      */
Please login to merge, or discard this patch.