Completed
Pull Request — master (#370)
by Maxence
02:03
created
lib/Vendor/Psr/Clock/ClockInterface.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -5,8 +5,8 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3,8 +3,7 @@
 block discarded – undo
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
      */
Please login to merge, or discard this patch.
lib/Vendor/Psr/EventDispatcher/ListenerProviderInterface.php 3 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -8,12 +8,12 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
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
 /**
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -6,8 +6,7 @@
 block discarded – undo
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.
Please login to merge, or discard this patch.
lib/Vendor/Psr/EventDispatcher/EventDispatcherInterface.php 3 patches
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -8,14 +8,14 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -6,8 +6,7 @@
 block discarded – undo
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
      *
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
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
 /**
Please login to merge, or discard this patch.
lib/Vendor/Psr/EventDispatcher/StoppableEventInterface.php 3 patches
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -12,15 +12,15 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -10,8 +10,7 @@
 block discarded – undo
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
      *
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
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
 /**
Please login to merge, or discard this patch.
lib/Vendor/Psr/Container/ContainerExceptionInterface.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -6,6 +6,5 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
lib/Vendor/Psr/Container/ContainerInterface.php 3 patches
Indentation   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -8,27 +8,27 @@
 block discarded – undo
8 8
  */
9 9
 interface ContainerInterface
10 10
 {
11
-    /**
12
-     * Finds an entry of the container by its identifier and returns it.
13
-     *
14
-     * @param string $id Identifier of the entry to look for.
15
-     *
16
-     * @throws NotFoundExceptionInterface  No entry was found for **this** identifier.
17
-     * @throws ContainerExceptionInterface Error while retrieving the entry.
18
-     *
19
-     * @return mixed Entry.
20
-     */
21
-    public function get(string $id);
22
-    /**
23
-     * Returns true if the container can return an entry for the given identifier.
24
-     * Returns false otherwise.
25
-     *
26
-     * `has($id)` returning true does not mean that `get($id)` will not throw an exception.
27
-     * It does however mean that `get($id)` will not throw a `NotFoundExceptionInterface`.
28
-     *
29
-     * @param string $id Identifier of the entry to look for.
30
-     *
31
-     * @return bool
32
-     */
33
-    public function has(string $id) : bool;
11
+	/**
12
+	 * Finds an entry of the container by its identifier and returns it.
13
+	 *
14
+	 * @param string $id Identifier of the entry to look for.
15
+	 *
16
+	 * @throws NotFoundExceptionInterface  No entry was found for **this** identifier.
17
+	 * @throws ContainerExceptionInterface Error while retrieving the entry.
18
+	 *
19
+	 * @return mixed Entry.
20
+	 */
21
+	public function get(string $id);
22
+	/**
23
+	 * Returns true if the container can return an entry for the given identifier.
24
+	 * Returns false otherwise.
25
+	 *
26
+	 * `has($id)` returning true does not mean that `get($id)` will not throw an exception.
27
+	 * It does however mean that `get($id)` will not throw a `NotFoundExceptionInterface`.
28
+	 *
29
+	 * @param string $id Identifier of the entry to look for.
30
+	 *
31
+	 * @return bool
32
+	 */
33
+	public function has(string $id) : bool;
34 34
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare (strict_types=1);
3
+declare(strict_types=1);
4 4
 namespace OCA\FullTextSearch_Elasticsearch\Vendor\Psr\Container;
5 5
 
6 6
 /**
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -6,8 +6,7 @@
 block discarded – undo
6 6
 /**
7 7
  * Describes the interface of a container that exposes methods to read its entries.
8 8
  */
9
-interface ContainerInterface
10
-{
9
+interface ContainerInterface {
11 10
     /**
12 11
      * Finds an entry of the container by its identifier and returns it.
13 12
      *
Please login to merge, or discard this patch.
lib/Vendor/Psr/Container/NotFoundExceptionInterface.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -5,6 +5,5 @@
 block discarded – undo
5 5
 /**
6 6
  * No entry was found in the container.
7 7
  */
8
-interface NotFoundExceptionInterface extends ContainerExceptionInterface
9
-{
8
+interface NotFoundExceptionInterface extends ContainerExceptionInterface {
10 9
 }
Please login to merge, or discard this patch.
lib/Vendor/Elastic/Elasticsearch/Client.php 3 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
  * Elasticsearch B.V licenses this file to you under the MIT License.
12 12
  * See the LICENSE file in the project root for more information.
13 13
  */
14
-declare (strict_types=1);
14
+declare(strict_types=1);
15 15
 namespace OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Elasticsearch;
16 16
 
17 17
 use OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Elasticsearch\Response\Elasticsearch;
Please login to merge, or discard this patch.
Indentation   +119 added lines, -119 removed lines patch added patch discarded remove patch
@@ -26,123 +26,123 @@
 block discarded – undo
26 26
 use Psr\Log\LoggerInterface;
27 27
 final class Client implements ClientInterface
28 28
 {
29
-    const CLIENT_NAME = 'es';
30
-    const VERSION = '8.13.0';
31
-    const API_COMPATIBILITY_HEADER = '%s/vnd.elasticsearch+%s; compatible-with=8';
32
-    use ClientEndpointsTrait;
33
-    use EndpointTrait;
34
-    use NamespaceTrait;
35
-    protected Transport $transport;
36
-    protected LoggerInterface $logger;
37
-    /**
38
-     * Specify is the request is asyncronous
39
-     */
40
-    protected bool $async = \false;
41
-    /**
42
-     * Enable or disable the x-elastic-meta-header
43
-     */
44
-    protected bool $elasticMetaHeader = \true;
45
-    /**
46
-     * Enable or disable the response Exception
47
-     */
48
-    protected bool $responseException = \true;
49
-    /**
50
-     * The endpoint namespace storage 
51
-     */
52
-    protected array $namespace;
53
-    public function __construct(Transport $transport, LoggerInterface $logger)
54
-    {
55
-        $this->transport = $transport;
56
-        $this->logger = $logger;
57
-        $this->defaultTransportSettings($this->transport);
58
-    }
59
-    /**
60
-     * @inheritdoc
61
-     */
62
-    public function getTransport() : Transport
63
-    {
64
-        return $this->transport;
65
-    }
66
-    /**
67
-     * @inheritdoc
68
-     */
69
-    public function getLogger() : LoggerInterface
70
-    {
71
-        return $this->logger;
72
-    }
73
-    /**
74
-     * Set the default settings for Elasticsearch
75
-     */
76
-    protected function defaultTransportSettings(Transport $transport) : void
77
-    {
78
-        $transport->setUserAgent('elasticsearch-php', self::VERSION);
79
-    }
80
-    /**
81
-     * @inheritdoc
82
-     */
83
-    public function setAsync(bool $async) : self
84
-    {
85
-        $this->async = $async;
86
-        return $this;
87
-    }
88
-    /**
89
-     * @inheritdoc
90
-     */
91
-    public function getAsync() : bool
92
-    {
93
-        return $this->async;
94
-    }
95
-    /**
96
-     * @inheritdoc
97
-     */
98
-    public function setElasticMetaHeader(bool $active) : self
99
-    {
100
-        $this->elasticMetaHeader = $active;
101
-        return $this;
102
-    }
103
-    /**
104
-     * @inheritdoc
105
-     */
106
-    public function getElasticMetaHeader() : bool
107
-    {
108
-        return $this->elasticMetaHeader;
109
-    }
110
-    /**
111
-     * @inheritdoc
112
-     */
113
-    public function setResponseException(bool $active) : self
114
-    {
115
-        $this->responseException = $active;
116
-        return $this;
117
-    }
118
-    /**
119
-     * @inheritdoc
120
-     */
121
-    public function getResponseException() : bool
122
-    {
123
-        return $this->responseException;
124
-    }
125
-    /**
126
-     * @inheritdoc
127
-     */
128
-    public function sendRequest(RequestInterface $request)
129
-    {
130
-        // If async returns a Promise
131
-        if ($this->getAsync()) {
132
-            if ($this->getElasticMetaHeader()) {
133
-                $this->transport->setElasticMetaHeader(Client::CLIENT_NAME, Client::VERSION, \true);
134
-            }
135
-            $this->transport->setAsyncOnSuccess($request->getMethod() === 'HEAD' ? new AsyncOnSuccessNoException() : ($this->getResponseException() ? new AsyncOnSuccess() : new AsyncOnSuccessNoException()));
136
-            return $this->transport->sendAsyncRequest($request);
137
-        }
138
-        if ($this->getElasticMetaHeader()) {
139
-            $this->transport->setElasticMetaHeader(Client::CLIENT_NAME, Client::VERSION, \false);
140
-        }
141
-        $start = \microtime(\true);
142
-        $response = $this->transport->sendRequest($request);
143
-        $this->logger->info(\sprintf("Response time in %.3f sec", \microtime(\true) - $start));
144
-        $result = new Elasticsearch();
145
-        $result->setResponse($response, $request->getMethod() === 'HEAD' ? \false : $this->getResponseException());
146
-        return $result;
147
-    }
29
+	const CLIENT_NAME = 'es';
30
+	const VERSION = '8.13.0';
31
+	const API_COMPATIBILITY_HEADER = '%s/vnd.elasticsearch+%s; compatible-with=8';
32
+	use ClientEndpointsTrait;
33
+	use EndpointTrait;
34
+	use NamespaceTrait;
35
+	protected Transport $transport;
36
+	protected LoggerInterface $logger;
37
+	/**
38
+	 * Specify is the request is asyncronous
39
+	 */
40
+	protected bool $async = \false;
41
+	/**
42
+	 * Enable or disable the x-elastic-meta-header
43
+	 */
44
+	protected bool $elasticMetaHeader = \true;
45
+	/**
46
+	 * Enable or disable the response Exception
47
+	 */
48
+	protected bool $responseException = \true;
49
+	/**
50
+	 * The endpoint namespace storage 
51
+	 */
52
+	protected array $namespace;
53
+	public function __construct(Transport $transport, LoggerInterface $logger)
54
+	{
55
+		$this->transport = $transport;
56
+		$this->logger = $logger;
57
+		$this->defaultTransportSettings($this->transport);
58
+	}
59
+	/**
60
+	 * @inheritdoc
61
+	 */
62
+	public function getTransport() : Transport
63
+	{
64
+		return $this->transport;
65
+	}
66
+	/**
67
+	 * @inheritdoc
68
+	 */
69
+	public function getLogger() : LoggerInterface
70
+	{
71
+		return $this->logger;
72
+	}
73
+	/**
74
+	 * Set the default settings for Elasticsearch
75
+	 */
76
+	protected function defaultTransportSettings(Transport $transport) : void
77
+	{
78
+		$transport->setUserAgent('elasticsearch-php', self::VERSION);
79
+	}
80
+	/**
81
+	 * @inheritdoc
82
+	 */
83
+	public function setAsync(bool $async) : self
84
+	{
85
+		$this->async = $async;
86
+		return $this;
87
+	}
88
+	/**
89
+	 * @inheritdoc
90
+	 */
91
+	public function getAsync() : bool
92
+	{
93
+		return $this->async;
94
+	}
95
+	/**
96
+	 * @inheritdoc
97
+	 */
98
+	public function setElasticMetaHeader(bool $active) : self
99
+	{
100
+		$this->elasticMetaHeader = $active;
101
+		return $this;
102
+	}
103
+	/**
104
+	 * @inheritdoc
105
+	 */
106
+	public function getElasticMetaHeader() : bool
107
+	{
108
+		return $this->elasticMetaHeader;
109
+	}
110
+	/**
111
+	 * @inheritdoc
112
+	 */
113
+	public function setResponseException(bool $active) : self
114
+	{
115
+		$this->responseException = $active;
116
+		return $this;
117
+	}
118
+	/**
119
+	 * @inheritdoc
120
+	 */
121
+	public function getResponseException() : bool
122
+	{
123
+		return $this->responseException;
124
+	}
125
+	/**
126
+	 * @inheritdoc
127
+	 */
128
+	public function sendRequest(RequestInterface $request)
129
+	{
130
+		// If async returns a Promise
131
+		if ($this->getAsync()) {
132
+			if ($this->getElasticMetaHeader()) {
133
+				$this->transport->setElasticMetaHeader(Client::CLIENT_NAME, Client::VERSION, \true);
134
+			}
135
+			$this->transport->setAsyncOnSuccess($request->getMethod() === 'HEAD' ? new AsyncOnSuccessNoException() : ($this->getResponseException() ? new AsyncOnSuccess() : new AsyncOnSuccessNoException()));
136
+			return $this->transport->sendAsyncRequest($request);
137
+		}
138
+		if ($this->getElasticMetaHeader()) {
139
+			$this->transport->setElasticMetaHeader(Client::CLIENT_NAME, Client::VERSION, \false);
140
+		}
141
+		$start = \microtime(\true);
142
+		$response = $this->transport->sendRequest($request);
143
+		$this->logger->info(\sprintf("Response time in %.3f sec", \microtime(\true) - $start));
144
+		$result = new Elasticsearch();
145
+		$result->setResponse($response, $request->getMethod() === 'HEAD' ? \false : $this->getResponseException());
146
+		return $result;
147
+	}
148 148
 }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,8 +24,7 @@
 block discarded – undo
24 24
 use OCA\FullTextSearch_Elasticsearch\Vendor\Http\Promise\Promise;
25 25
 use OCA\FullTextSearch_Elasticsearch\Vendor\Psr\Http\Message\RequestInterface;
26 26
 use Psr\Log\LoggerInterface;
27
-final class Client implements ClientInterface
28
-{
27
+final class Client implements ClientInterface {
29 28
     const CLIENT_NAME = 'es';
30 29
     const VERSION = '8.13.0';
31 30
     const API_COMPATIBILITY_HEADER = '%s/vnd.elasticsearch+%s; compatible-with=8';
Please login to merge, or discard this patch.
lib/Vendor/Elastic/Elasticsearch/Response/ElasticsearchInterface.php 3 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -17,8 +17,8 @@
 block discarded – undo
17 17
 use OCA\FullTextSearch_Elasticsearch\Vendor\Psr\Http\Message\ResponseInterface;
18 18
 interface ElasticsearchInterface
19 19
 {
20
-    /**
21
-     * Set the HTTP PSR-7 response 
22
-     */
23
-    public function setResponse(ResponseInterface $response, bool $throwException = \true) : void;
20
+	/**
21
+	 * Set the HTTP PSR-7 response 
22
+	 */
23
+	public function setResponse(ResponseInterface $response, bool $throwException = \true) : void;
24 24
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
  * Elasticsearch B.V licenses this file to you under the MIT License.
12 12
  * See the LICENSE file in the project root for more information.
13 13
  */
14
-declare (strict_types=1);
14
+declare(strict_types=1);
15 15
 namespace OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Elasticsearch\Response;
16 16
 
17 17
 use OCA\FullTextSearch_Elasticsearch\Vendor\Psr\Http\Message\ResponseInterface;
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -15,8 +15,7 @@
 block discarded – undo
15 15
 namespace OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Elasticsearch\Response;
16 16
 
17 17
 use OCA\FullTextSearch_Elasticsearch\Vendor\Psr\Http\Message\ResponseInterface;
18
-interface ElasticsearchInterface
19
-{
18
+interface ElasticsearchInterface {
20 19
     /**
21 20
      * Set the HTTP PSR-7 response 
22 21
      */
Please login to merge, or discard this patch.