@@ -3,8 +3,7 @@ |
||
| 3 | 3 | namespace OCA\FullTextSearch_Elasticsearch\Vendor\Http\Client\Exception; |
| 4 | 4 | |
| 5 | 5 | use OCA\FullTextSearch_Elasticsearch\Vendor\Psr\Http\Message\RequestInterface; |
| 6 | -trait RequestAwareTrait |
|
| 7 | -{ |
|
| 6 | +trait RequestAwareTrait { |
|
| 8 | 7 | /** |
| 9 | 8 | * @var RequestInterface |
| 10 | 9 | */ |
@@ -5,16 +5,16 @@ |
||
| 5 | 5 | use OCA\FullTextSearch_Elasticsearch\Vendor\Psr\Http\Message\RequestInterface; |
| 6 | 6 | trait RequestAwareTrait |
| 7 | 7 | { |
| 8 | - /** |
|
| 9 | - * @var RequestInterface |
|
| 10 | - */ |
|
| 11 | - private $request; |
|
| 12 | - private function setRequest(RequestInterface $request) |
|
| 13 | - { |
|
| 14 | - $this->request = $request; |
|
| 15 | - } |
|
| 16 | - public function getRequest() : RequestInterface |
|
| 17 | - { |
|
| 18 | - return $this->request; |
|
| 19 | - } |
|
| 8 | + /** |
|
| 9 | + * @var RequestInterface |
|
| 10 | + */ |
|
| 11 | + private $request; |
|
| 12 | + private function setRequest(RequestInterface $request) |
|
| 13 | + { |
|
| 14 | + $this->request = $request; |
|
| 15 | + } |
|
| 16 | + public function getRequest() : RequestInterface |
|
| 17 | + { |
|
| 18 | + return $this->request; |
|
| 19 | + } |
|
| 20 | 20 | } |
@@ -12,8 +12,7 @@ |
||
| 12 | 12 | * |
| 13 | 13 | * @author Márk Sági-Kazár <[email protected]> |
| 14 | 14 | */ |
| 15 | -class RequestException extends TransferException implements PsrRequestException |
|
| 16 | -{ |
|
| 15 | +class RequestException extends TransferException implements PsrRequestException { |
|
| 17 | 16 | use RequestAwareTrait; |
| 18 | 17 | /** |
| 19 | 18 | * @param string $message |
@@ -14,13 +14,13 @@ |
||
| 14 | 14 | */ |
| 15 | 15 | class RequestException extends TransferException implements PsrRequestException |
| 16 | 16 | { |
| 17 | - use RequestAwareTrait; |
|
| 18 | - /** |
|
| 19 | - * @param string $message |
|
| 20 | - */ |
|
| 21 | - public function __construct($message, RequestInterface $request, ?\Exception $previous = null) |
|
| 22 | - { |
|
| 23 | - $this->setRequest($request); |
|
| 24 | - parent::__construct($message, 0, $previous); |
|
| 25 | - } |
|
| 17 | + use RequestAwareTrait; |
|
| 18 | + /** |
|
| 19 | + * @param string $message |
|
| 20 | + */ |
|
| 21 | + public function __construct($message, RequestInterface $request, ?\Exception $previous = null) |
|
| 22 | + { |
|
| 23 | + $this->setRequest($request); |
|
| 24 | + parent::__construct($message, 0, $previous); |
|
| 25 | + } |
|
| 26 | 26 | } |
@@ -5,8 +5,7 @@ |
||
| 5 | 5 | use OCA\FullTextSearch_Elasticsearch\Vendor\Http\Client\Exception; |
| 6 | 6 | use OCA\FullTextSearch_Elasticsearch\Vendor\Http\Promise\Promise; |
| 7 | 7 | use OCA\FullTextSearch_Elasticsearch\Vendor\Psr\Http\Message\ResponseInterface; |
| 8 | -final class HttpFulfilledPromise implements Promise |
|
| 9 | -{ |
|
| 8 | +final class HttpFulfilledPromise implements Promise { |
|
| 10 | 9 | /** |
| 11 | 10 | * @var ResponseInterface |
| 12 | 11 | */ |
@@ -7,33 +7,33 @@ |
||
| 7 | 7 | use OCA\FullTextSearch_Elasticsearch\Vendor\Psr\Http\Message\ResponseInterface; |
| 8 | 8 | final class HttpFulfilledPromise implements Promise |
| 9 | 9 | { |
| 10 | - /** |
|
| 11 | - * @var ResponseInterface |
|
| 12 | - */ |
|
| 13 | - private $response; |
|
| 14 | - public function __construct(ResponseInterface $response) |
|
| 15 | - { |
|
| 16 | - $this->response = $response; |
|
| 17 | - } |
|
| 18 | - public function then(?callable $onFulfilled = null, ?callable $onRejected = null) |
|
| 19 | - { |
|
| 20 | - if (null === $onFulfilled) { |
|
| 21 | - return $this; |
|
| 22 | - } |
|
| 23 | - try { |
|
| 24 | - return new self($onFulfilled($this->response)); |
|
| 25 | - } catch (Exception $e) { |
|
| 26 | - return new HttpRejectedPromise($e); |
|
| 27 | - } |
|
| 28 | - } |
|
| 29 | - public function getState() |
|
| 30 | - { |
|
| 31 | - return Promise::FULFILLED; |
|
| 32 | - } |
|
| 33 | - public function wait($unwrap = \true) |
|
| 34 | - { |
|
| 35 | - if ($unwrap) { |
|
| 36 | - return $this->response; |
|
| 37 | - } |
|
| 38 | - } |
|
| 10 | + /** |
|
| 11 | + * @var ResponseInterface |
|
| 12 | + */ |
|
| 13 | + private $response; |
|
| 14 | + public function __construct(ResponseInterface $response) |
|
| 15 | + { |
|
| 16 | + $this->response = $response; |
|
| 17 | + } |
|
| 18 | + public function then(?callable $onFulfilled = null, ?callable $onRejected = null) |
|
| 19 | + { |
|
| 20 | + if (null === $onFulfilled) { |
|
| 21 | + return $this; |
|
| 22 | + } |
|
| 23 | + try { |
|
| 24 | + return new self($onFulfilled($this->response)); |
|
| 25 | + } catch (Exception $e) { |
|
| 26 | + return new HttpRejectedPromise($e); |
|
| 27 | + } |
|
| 28 | + } |
|
| 29 | + public function getState() |
|
| 30 | + { |
|
| 31 | + return Promise::FULFILLED; |
|
| 32 | + } |
|
| 33 | + public function wait($unwrap = \true) |
|
| 34 | + { |
|
| 35 | + if ($unwrap) { |
|
| 36 | + return $this->response; |
|
| 37 | + } |
|
| 38 | + } |
|
| 39 | 39 | } |
@@ -11,6 +11,5 @@ |
||
| 11 | 11 | * |
| 12 | 12 | * @deprecated since version 2.4, use Psr\Http\Client\ClientInterface instead; see https://www.php-fig.org/psr/psr-18/ |
| 13 | 13 | */ |
| 14 | -interface HttpClient extends ClientInterface |
|
| 15 | -{ |
|
| 14 | +interface HttpClient extends ClientInterface { |
|
| 16 | 15 | } |
@@ -5,8 +5,8 @@ |
||
| 5 | 5 | use DateTimeImmutable; |
| 6 | 6 | interface ClockInterface |
| 7 | 7 | { |
| 8 | - /** |
|
| 9 | - * Returns the current time as a DateTimeImmutable Object |
|
| 10 | - */ |
|
| 11 | - public function now() : DateTimeImmutable; |
|
| 8 | + /** |
|
| 9 | + * Returns the current time as a DateTimeImmutable Object |
|
| 10 | + */ |
|
| 11 | + public function now() : DateTimeImmutable; |
|
| 12 | 12 | } |
@@ -3,8 +3,7 @@ |
||
| 3 | 3 | namespace OCA\FullTextSearch_Elasticsearch\Vendor\Psr\Clock; |
| 4 | 4 | |
| 5 | 5 | use DateTimeImmutable; |
| 6 | -interface ClockInterface |
|
| 7 | -{ |
|
| 6 | +interface ClockInterface { |
|
| 8 | 7 | /** |
| 9 | 8 | * Returns the current time as a DateTimeImmutable Object |
| 10 | 9 | */ |
@@ -8,12 +8,12 @@ |
||
| 8 | 8 | */ |
| 9 | 9 | interface ListenerProviderInterface |
| 10 | 10 | { |
| 11 | - /** |
|
| 12 | - * @param object $event |
|
| 13 | - * An event for which to return the relevant listeners. |
|
| 14 | - * @return iterable[callable] |
|
| 15 | - * An iterable (array, iterator, or generator) of callables. Each |
|
| 16 | - * callable MUST be type-compatible with $event. |
|
| 17 | - */ |
|
| 18 | - public function getListenersForEvent(object $event) : iterable; |
|
| 11 | + /** |
|
| 12 | + * @param object $event |
|
| 13 | + * An event for which to return the relevant listeners. |
|
| 14 | + * @return iterable[callable] |
|
| 15 | + * An iterable (array, iterator, or generator) of callables. Each |
|
| 16 | + * callable MUST be type-compatible with $event. |
|
| 17 | + */ |
|
| 18 | + public function getListenersForEvent(object $event) : iterable; |
|
| 19 | 19 | } |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare (strict_types=1); |
|
| 3 | +declare(strict_types=1); |
|
| 4 | 4 | namespace OCA\FullTextSearch_Elasticsearch\Vendor\Psr\EventDispatcher; |
| 5 | 5 | |
| 6 | 6 | /** |
@@ -6,8 +6,7 @@ |
||
| 6 | 6 | /** |
| 7 | 7 | * Mapper from an event to the listeners that are applicable to that event. |
| 8 | 8 | */ |
| 9 | -interface ListenerProviderInterface |
|
| 10 | -{ |
|
| 9 | +interface ListenerProviderInterface { |
|
| 11 | 10 | /** |
| 12 | 11 | * @param object $event |
| 13 | 12 | * An event for which to return the relevant listeners. |
@@ -8,14 +8,14 @@ |
||
| 8 | 8 | */ |
| 9 | 9 | interface EventDispatcherInterface |
| 10 | 10 | { |
| 11 | - /** |
|
| 12 | - * Provide all relevant listeners with an event to process. |
|
| 13 | - * |
|
| 14 | - * @param object $event |
|
| 15 | - * The object to process. |
|
| 16 | - * |
|
| 17 | - * @return object |
|
| 18 | - * The Event that was passed, now modified by listeners. |
|
| 19 | - */ |
|
| 20 | - public function dispatch(object $event); |
|
| 11 | + /** |
|
| 12 | + * Provide all relevant listeners with an event to process. |
|
| 13 | + * |
|
| 14 | + * @param object $event |
|
| 15 | + * The object to process. |
|
| 16 | + * |
|
| 17 | + * @return object |
|
| 18 | + * The Event that was passed, now modified by listeners. |
|
| 19 | + */ |
|
| 20 | + public function dispatch(object $event); |
|
| 21 | 21 | } |
@@ -6,8 +6,7 @@ |
||
| 6 | 6 | /** |
| 7 | 7 | * Defines a dispatcher for events. |
| 8 | 8 | */ |
| 9 | -interface EventDispatcherInterface |
|
| 10 | -{ |
|
| 9 | +interface EventDispatcherInterface { |
|
| 11 | 10 | /** |
| 12 | 11 | * Provide all relevant listeners with an event to process. |
| 13 | 12 | * |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare (strict_types=1); |
|
| 3 | +declare(strict_types=1); |
|
| 4 | 4 | namespace OCA\FullTextSearch_Elasticsearch\Vendor\Psr\EventDispatcher; |
| 5 | 5 | |
| 6 | 6 | /** |
@@ -12,15 +12,15 @@ |
||
| 12 | 12 | */ |
| 13 | 13 | interface StoppableEventInterface |
| 14 | 14 | { |
| 15 | - /** |
|
| 16 | - * Is propagation stopped? |
|
| 17 | - * |
|
| 18 | - * This will typically only be used by the Dispatcher to determine if the |
|
| 19 | - * previous listener halted propagation. |
|
| 20 | - * |
|
| 21 | - * @return bool |
|
| 22 | - * True if the Event is complete and no further listeners should be called. |
|
| 23 | - * False to continue calling listeners. |
|
| 24 | - */ |
|
| 25 | - public function isPropagationStopped() : bool; |
|
| 15 | + /** |
|
| 16 | + * Is propagation stopped? |
|
| 17 | + * |
|
| 18 | + * This will typically only be used by the Dispatcher to determine if the |
|
| 19 | + * previous listener halted propagation. |
|
| 20 | + * |
|
| 21 | + * @return bool |
|
| 22 | + * True if the Event is complete and no further listeners should be called. |
|
| 23 | + * False to continue calling listeners. |
|
| 24 | + */ |
|
| 25 | + public function isPropagationStopped() : bool; |
|
| 26 | 26 | } |
@@ -10,8 +10,7 @@ |
||
| 10 | 10 | * is marked as stopped after each listener is called. If it is then it should |
| 11 | 11 | * return immediately without calling any further Listeners. |
| 12 | 12 | */ |
| 13 | -interface StoppableEventInterface |
|
| 14 | -{ |
|
| 13 | +interface StoppableEventInterface { |
|
| 15 | 14 | /** |
| 16 | 15 | * Is propagation stopped? |
| 17 | 16 | * |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare (strict_types=1); |
|
| 3 | +declare(strict_types=1); |
|
| 4 | 4 | namespace OCA\FullTextSearch_Elasticsearch\Vendor\Psr\EventDispatcher; |
| 5 | 5 | |
| 6 | 6 | /** |
@@ -6,6 +6,5 @@ |
||
| 6 | 6 | /** |
| 7 | 7 | * Base interface representing a generic exception in a container. |
| 8 | 8 | */ |
| 9 | -interface ContainerExceptionInterface extends Throwable |
|
| 10 | -{ |
|
| 9 | +interface ContainerExceptionInterface extends Throwable { |
|
| 11 | 10 | } |