Completed
Push — master ( 8e973a...811a95 )
by
unknown
03:40 queued 01:04
created
lib/Vendor/Elastic/Transport/Exception/TransportException.php 2 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\Transport\Exception;
16 16
 
17 17
 use Throwable;
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -15,6 +15,5 @@
 block discarded – undo
15 15
 namespace OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Transport\Exception;
16 16
 
17 17
 use Throwable;
18
-interface TransportException extends Throwable
19
-{
18
+interface TransportException extends Throwable {
20 19
 }
Please login to merge, or discard this patch.
lib/Vendor/Elastic/Transport/TransportBuilder.php 3 patches
Indentation   +79 added lines, -79 removed lines patch added patch discarded remove patch
@@ -26,83 +26,83 @@
 block discarded – undo
26 26
 use Throwable;
27 27
 class TransportBuilder
28 28
 {
29
-    protected ClientInterface $client;
30
-    protected NodePoolInterface $nodePool;
31
-    protected LoggerInterface $logger;
32
-    protected array $hosts = [];
33
-    public final function __construct()
34
-    {
35
-    }
36
-    public static function create() : TransportBuilder
37
-    {
38
-        return new static();
39
-    }
40
-    public function setClient(ClientInterface $client) : self
41
-    {
42
-        $this->client = $client;
43
-        return $this;
44
-    }
45
-    public function getClient() : ClientInterface
46
-    {
47
-        if (empty($this->client)) {
48
-            $this->client = Psr18ClientDiscovery::find();
49
-        }
50
-        return $this->client;
51
-    }
52
-    public function setNodePool(NodePoolInterface $nodePool) : self
53
-    {
54
-        $this->nodePool = $nodePool;
55
-        return $this;
56
-    }
57
-    public function getNodePool() : NodePoolInterface
58
-    {
59
-        if (empty($this->nodePool)) {
60
-            $this->nodePool = new SimpleNodePool(new RoundRobin(), new NoResurrect());
61
-        }
62
-        return $this->nodePool;
63
-    }
64
-    public function setLogger(LoggerInterface $logger) : self
65
-    {
66
-        $this->logger = $logger;
67
-        return $this;
68
-    }
69
-    public function getLogger() : LoggerInterface
70
-    {
71
-        if (empty($this->logger)) {
72
-            $this->logger = new NullLogger();
73
-        }
74
-        return $this->logger;
75
-    }
76
-    public function setHosts(array $hosts) : self
77
-    {
78
-        $this->hosts = $hosts;
79
-        return $this;
80
-    }
81
-    public function getHosts() : array
82
-    {
83
-        return $this->hosts;
84
-    }
85
-    public function setCloudId(string $cloudId) : self
86
-    {
87
-        $this->hosts = [$this->parseElasticCloudId($cloudId)];
88
-        return $this;
89
-    }
90
-    public function build() : Transport
91
-    {
92
-        return new Transport($this->getClient(), $this->getNodePool()->setHosts($this->hosts), $this->getLogger());
93
-    }
94
-    /**
95
-     * Return the URL of Elastic Cloud from the Cloud ID
96
-     */
97
-    private function parseElasticCloudId(string $cloudId) : string
98
-    {
99
-        try {
100
-            list($name, $encoded) = \explode(':', $cloudId);
101
-            list($uri, $uuids) = \explode('$', \base64_decode($encoded));
102
-            list($es, ) = \explode(':', $uuids);
103
-            return \sprintf("https://%s.%s", $es, $uri);
104
-        } catch (Throwable $t) {
105
-            throw new Exception\CloudIdParseException('Cloud ID not valid');
106
-        }
107
-    }
29
+	protected ClientInterface $client;
30
+	protected NodePoolInterface $nodePool;
31
+	protected LoggerInterface $logger;
32
+	protected array $hosts = [];
33
+	public final function __construct()
34
+	{
35
+	}
36
+	public static function create() : TransportBuilder
37
+	{
38
+		return new static();
39
+	}
40
+	public function setClient(ClientInterface $client) : self
41
+	{
42
+		$this->client = $client;
43
+		return $this;
44
+	}
45
+	public function getClient() : ClientInterface
46
+	{
47
+		if (empty($this->client)) {
48
+			$this->client = Psr18ClientDiscovery::find();
49
+		}
50
+		return $this->client;
51
+	}
52
+	public function setNodePool(NodePoolInterface $nodePool) : self
53
+	{
54
+		$this->nodePool = $nodePool;
55
+		return $this;
56
+	}
57
+	public function getNodePool() : NodePoolInterface
58
+	{
59
+		if (empty($this->nodePool)) {
60
+			$this->nodePool = new SimpleNodePool(new RoundRobin(), new NoResurrect());
61
+		}
62
+		return $this->nodePool;
63
+	}
64
+	public function setLogger(LoggerInterface $logger) : self
65
+	{
66
+		$this->logger = $logger;
67
+		return $this;
68
+	}
69
+	public function getLogger() : LoggerInterface
70
+	{
71
+		if (empty($this->logger)) {
72
+			$this->logger = new NullLogger();
73
+		}
74
+		return $this->logger;
75
+	}
76
+	public function setHosts(array $hosts) : self
77
+	{
78
+		$this->hosts = $hosts;
79
+		return $this;
80
+	}
81
+	public function getHosts() : array
82
+	{
83
+		return $this->hosts;
84
+	}
85
+	public function setCloudId(string $cloudId) : self
86
+	{
87
+		$this->hosts = [$this->parseElasticCloudId($cloudId)];
88
+		return $this;
89
+	}
90
+	public function build() : Transport
91
+	{
92
+		return new Transport($this->getClient(), $this->getNodePool()->setHosts($this->hosts), $this->getLogger());
93
+	}
94
+	/**
95
+	 * Return the URL of Elastic Cloud from the Cloud ID
96
+	 */
97
+	private function parseElasticCloudId(string $cloudId) : string
98
+	{
99
+		try {
100
+			list($name, $encoded) = \explode(':', $cloudId);
101
+			list($uri, $uuids) = \explode('$', \base64_decode($encoded));
102
+			list($es, ) = \explode(':', $uuids);
103
+			return \sprintf("https://%s.%s", $es, $uri);
104
+		} catch (Throwable $t) {
105
+			throw new Exception\CloudIdParseException('Cloud ID not valid');
106
+		}
107
+	}
108 108
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 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\Transport;
16 16
 
17 17
 use OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Transport\NodePool\NodePoolInterface;
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
         try {
100 100
             list($name, $encoded) = \explode(':', $cloudId);
101 101
             list($uri, $uuids) = \explode('$', \base64_decode($encoded));
102
-            list($es, ) = \explode(':', $uuids);
102
+            list($es,) = \explode(':', $uuids);
103 103
             return \sprintf("https://%s.%s", $es, $uri);
104 104
         } catch (Throwable $t) {
105 105
             throw new Exception\CloudIdParseException('Cloud ID not valid');
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 Psr\Log\LoggerInterface;
25 25
 use Psr\Log\NullLogger;
26 26
 use Throwable;
27
-class TransportBuilder
28
-{
27
+class TransportBuilder {
29 28
     protected ClientInterface $client;
30 29
     protected NodePoolInterface $nodePool;
31 30
     protected LoggerInterface $logger;
Please login to merge, or discard this patch.
lib/Vendor/Elastic/Transport/NodePool/Node.php 3 patches
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -20,25 +20,25 @@
 block discarded – undo
20 20
 use function substr;
21 21
 class Node
22 22
 {
23
-    protected UriInterface $uri;
24
-    protected bool $alive = \true;
25
-    public function __construct(string $host)
26
-    {
27
-        if (substr($host, 0, 5) !== 'http:' && substr($host, 0, 6) !== 'https:') {
28
-            $host = sprintf("http://%s", $host);
29
-        }
30
-        $this->uri = Psr17FactoryDiscovery::findUriFactory()->createUri($host);
31
-    }
32
-    public function markAlive(bool $alive) : void
33
-    {
34
-        $this->alive = $alive;
35
-    }
36
-    public function isAlive() : bool
37
-    {
38
-        return $this->alive;
39
-    }
40
-    public function getUri() : UriInterface
41
-    {
42
-        return $this->uri;
43
-    }
23
+	protected UriInterface $uri;
24
+	protected bool $alive = \true;
25
+	public function __construct(string $host)
26
+	{
27
+		if (substr($host, 0, 5) !== 'http:' && substr($host, 0, 6) !== 'https:') {
28
+			$host = sprintf("http://%s", $host);
29
+		}
30
+		$this->uri = Psr17FactoryDiscovery::findUriFactory()->createUri($host);
31
+	}
32
+	public function markAlive(bool $alive) : void
33
+	{
34
+		$this->alive = $alive;
35
+	}
36
+	public function isAlive() : bool
37
+	{
38
+		return $this->alive;
39
+	}
40
+	public function getUri() : UriInterface
41
+	{
42
+		return $this->uri;
43
+	}
44 44
 }
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\Transport\NodePool;
16 16
 
17 17
 use OCA\FullTextSearch_Elasticsearch\Vendor\Http\Discovery\Psr17FactoryDiscovery;
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -18,8 +18,7 @@
 block discarded – undo
18 18
 use OCA\FullTextSearch_Elasticsearch\Vendor\Psr\Http\Message\UriInterface;
19 19
 use function sprintf;
20 20
 use function substr;
21
-class Node
22
-{
21
+class Node {
23 22
     protected UriInterface $uri;
24 23
     protected bool $alive = \true;
25 24
     public function __construct(string $host)
Please login to merge, or discard this patch.
lib/Vendor/Elastic/Transport/NodePool/NodePoolInterface.php 3 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -16,9 +16,9 @@
 block discarded – undo
16 16
 
17 17
 interface NodePoolInterface
18 18
 {
19
-    public function nextNode() : Node;
20
-    /**
21
-     * @param string[] $hosts
22
-     */
23
-    public function setHosts(array $hosts) : self;
19
+	public function nextNode() : Node;
20
+	/**
21
+	 * @param string[] $hosts
22
+	 */
23
+	public function setHosts(array $hosts) : self;
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\Transport\NodePool;
16 16
 
17 17
 interface NodePoolInterface
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,8 +14,7 @@
 block discarded – undo
14 14
 declare (strict_types=1);
15 15
 namespace OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Transport\NodePool;
16 16
 
17
-interface NodePoolInterface
18
-{
17
+interface NodePoolInterface {
19 18
     public function nextNode() : Node;
20 19
     /**
21 20
      * @param string[] $hosts
Please login to merge, or discard this patch.
lib/Vendor/Elastic/Transport/NodePool/Selector/SelectorInterface.php 3 patches
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -17,13 +17,13 @@
 block discarded – undo
17 17
 use OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Transport\NodePool\Node;
18 18
 interface SelectorInterface
19 19
 {
20
-    public function nextNode() : Node;
21
-    /**
22
-     * @param Node[] $nodes
23
-     */
24
-    public function setNodes(array $nodes) : void;
25
-    /**
26
-     * @return Node[]
27
-     */
28
-    public function getNodes() : array;
20
+	public function nextNode() : Node;
21
+	/**
22
+	 * @param Node[] $nodes
23
+	 */
24
+	public function setNodes(array $nodes) : void;
25
+	/**
26
+	 * @return Node[]
27
+	 */
28
+	public function getNodes() : array;
29 29
 }
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\Transport\NodePool\Selector;
16 16
 
17 17
 use OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Transport\NodePool\Node;
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\Transport\NodePool\Selector;
16 16
 
17 17
 use OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Transport\NodePool\Node;
18
-interface SelectorInterface
19
-{
18
+interface SelectorInterface {
20 19
     public function nextNode() : Node;
21 20
     /**
22 21
      * @param Node[] $nodes
Please login to merge, or discard this patch.
lib/Vendor/Elastic/Transport/NodePool/Selector/RoundRobin.php 3 patches
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -18,17 +18,17 @@
 block discarded – undo
18 18
 use OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Transport\Exception\NoNodeAvailableException;
19 19
 class RoundRobin implements SelectorInterface
20 20
 {
21
-    use SelectorTrait;
22
-    public function nextNode() : Node
23
-    {
24
-        if (empty($this->getNodes())) {
25
-            $className = \substr(__CLASS__, \strrpos(__CLASS__, '\\') + 1);
26
-            throw new NoNodeAvailableException(\sprintf("No node available. Please use %s::setNodes() before calling %s::nextNode().", $className, $className));
27
-        }
28
-        $node = \current($this->nodes);
29
-        if (\false === \next($this->nodes)) {
30
-            \reset($this->nodes);
31
-        }
32
-        return $node;
33
-    }
21
+	use SelectorTrait;
22
+	public function nextNode() : Node
23
+	{
24
+		if (empty($this->getNodes())) {
25
+			$className = \substr(__CLASS__, \strrpos(__CLASS__, '\\') + 1);
26
+			throw new NoNodeAvailableException(\sprintf("No node available. Please use %s::setNodes() before calling %s::nextNode().", $className, $className));
27
+		}
28
+		$node = \current($this->nodes);
29
+		if (\false === \next($this->nodes)) {
30
+			\reset($this->nodes);
31
+		}
32
+		return $node;
33
+	}
34 34
 }
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
 use OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Transport\NodePool\Node;
18 18
 use OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Transport\Exception\NoNodeAvailableException;
19
-class RoundRobin implements SelectorInterface
20
-{
19
+class RoundRobin implements SelectorInterface {
21 20
     use SelectorTrait;
22 21
     public function nextNode() : Node
23 22
     {
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\Transport\NodePool\Selector;
16 16
 
17 17
 use OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Transport\NodePool\Node;
Please login to merge, or discard this patch.
lib/Vendor/Elastic/Transport/NodePool/Selector/SelectorTrait.php 3 patches
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -18,18 +18,18 @@
 block discarded – undo
18 18
 use OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Transport\Exception\InvalidArrayException;
19 19
 trait SelectorTrait
20 20
 {
21
-    protected array $nodes = [];
22
-    public function setNodes(array $nodes) : void
23
-    {
24
-        foreach ($nodes as $node) {
25
-            if (!$node instanceof Node) {
26
-                throw new InvalidArrayException(\sprintf("The nodes array must contain only %s objects", Node::class));
27
-            }
28
-        }
29
-        $this->nodes = $nodes;
30
-    }
31
-    public function getNodes() : array
32
-    {
33
-        return $this->nodes;
34
-    }
21
+	protected array $nodes = [];
22
+	public function setNodes(array $nodes) : void
23
+	{
24
+		foreach ($nodes as $node) {
25
+			if (!$node instanceof Node) {
26
+				throw new InvalidArrayException(\sprintf("The nodes array must contain only %s objects", Node::class));
27
+			}
28
+		}
29
+		$this->nodes = $nodes;
30
+	}
31
+	public function getNodes() : array
32
+	{
33
+		return $this->nodes;
34
+	}
35 35
 }
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
 use OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Transport\NodePool\Node;
18 18
 use OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Transport\Exception\InvalidArrayException;
19
-trait SelectorTrait
20
-{
19
+trait SelectorTrait {
21 20
     protected array $nodes = [];
22 21
     public function setNodes(array $nodes) : void
23 22
     {
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\Transport\NodePool\Selector;
16 16
 
17 17
 use OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Transport\NodePool\Node;
Please login to merge, or discard this patch.
lib/Vendor/Elastic/Transport/NodePool/SimpleNodePool.php 3 patches
Indentation   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -22,49 +22,49 @@
 block discarded – undo
22 22
 use function sprintf;
23 23
 class SimpleNodePool implements NodePoolInterface
24 24
 {
25
-    /**
26
-     * @var array
27
-     */
28
-    protected $nodes = [];
29
-    /**
30
-     * @var SelectorInterface
31
-     */
32
-    protected $selector;
33
-    /**
34
-     * @var ResurrectInterface
35
-     */
36
-    protected $resurrect;
37
-    public function __construct(SelectorInterface $selector, ResurrectInterface $resurrect)
38
-    {
39
-        $this->selector = $selector;
40
-        $this->resurrect = $resurrect;
41
-    }
42
-    public function setHosts(array $hosts) : self
43
-    {
44
-        $this->nodes = [];
45
-        foreach ($hosts as $host) {
46
-            $this->nodes[] = new Node($host);
47
-        }
48
-        shuffle($this->nodes);
49
-        // randomize for use different hosts on each execution
50
-        $this->selector->setNodes($this->nodes);
51
-        return $this;
52
-    }
53
-    public function nextNode() : Node
54
-    {
55
-        $totNodes = count($this->nodes);
56
-        $dead = 0;
57
-        while ($dead < $totNodes) {
58
-            $next = $this->selector->nextNode();
59
-            if ($next->isAlive()) {
60
-                return $next;
61
-            }
62
-            if ($this->resurrect->ping($next)) {
63
-                $next->markAlive(\true);
64
-                return $next;
65
-            }
66
-            $dead++;
67
-        }
68
-        throw new NoNodeAvailableException(sprintf('No alive nodes. All the %d nodes seem to be down.', $totNodes));
69
-    }
25
+	/**
26
+	 * @var array
27
+	 */
28
+	protected $nodes = [];
29
+	/**
30
+	 * @var SelectorInterface
31
+	 */
32
+	protected $selector;
33
+	/**
34
+	 * @var ResurrectInterface
35
+	 */
36
+	protected $resurrect;
37
+	public function __construct(SelectorInterface $selector, ResurrectInterface $resurrect)
38
+	{
39
+		$this->selector = $selector;
40
+		$this->resurrect = $resurrect;
41
+	}
42
+	public function setHosts(array $hosts) : self
43
+	{
44
+		$this->nodes = [];
45
+		foreach ($hosts as $host) {
46
+			$this->nodes[] = new Node($host);
47
+		}
48
+		shuffle($this->nodes);
49
+		// randomize for use different hosts on each execution
50
+		$this->selector->setNodes($this->nodes);
51
+		return $this;
52
+	}
53
+	public function nextNode() : Node
54
+	{
55
+		$totNodes = count($this->nodes);
56
+		$dead = 0;
57
+		while ($dead < $totNodes) {
58
+			$next = $this->selector->nextNode();
59
+			if ($next->isAlive()) {
60
+				return $next;
61
+			}
62
+			if ($this->resurrect->ping($next)) {
63
+				$next->markAlive(\true);
64
+				return $next;
65
+			}
66
+			$dead++;
67
+		}
68
+		throw new NoNodeAvailableException(sprintf('No alive nodes. All the %d nodes seem to be down.', $totNodes));
69
+	}
70 70
 }
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\Transport\NodePool;
16 16
 
17 17
 use OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Transport\NodePool\Resurrect\ResurrectInterface;
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
 use function count;
21 21
 use function shuffle;
22 22
 use function sprintf;
23
-class SimpleNodePool implements NodePoolInterface
24
-{
23
+class SimpleNodePool implements NodePoolInterface {
25 24
     /**
26 25
      * @var array
27 26
      */
Please login to merge, or discard this patch.
lib/Vendor/Elastic/Transport/NodePool/Resurrect/ElasticsearchResurrect.php 3 patches
Indentation   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -22,30 +22,30 @@
 block discarded – undo
22 22
 use OCA\FullTextSearch_Elasticsearch\Vendor\Psr\Http\Message\RequestFactoryInterface;
23 23
 class ElasticsearchResurrect implements ResurrectInterface
24 24
 {
25
-    protected ClientInterface $client;
26
-    protected RequestFactoryInterface $requestFactory;
27
-    public function ping(Node $node) : bool
28
-    {
29
-        $request = $this->getRequestFactory()->createRequest("HEAD", $node->getUri());
30
-        try {
31
-            $response = $this->getClient()->sendRequest($request);
32
-            return $response->getStatusCode() === 200;
33
-        } catch (Exception $e) {
34
-            return \false;
35
-        }
36
-    }
37
-    public function getClient() : ClientInterface
38
-    {
39
-        if (empty($this->client)) {
40
-            $this->client = Psr18ClientDiscovery::find();
41
-        }
42
-        return $this->client;
43
-    }
44
-    public function getRequestFactory() : RequestFactoryInterface
45
-    {
46
-        if (empty($this->requestFactory)) {
47
-            $this->requestFactory = Psr17FactoryDiscovery::findRequestFactory();
48
-        }
49
-        return $this->requestFactory;
50
-    }
25
+	protected ClientInterface $client;
26
+	protected RequestFactoryInterface $requestFactory;
27
+	public function ping(Node $node) : bool
28
+	{
29
+		$request = $this->getRequestFactory()->createRequest("HEAD", $node->getUri());
30
+		try {
31
+			$response = $this->getClient()->sendRequest($request);
32
+			return $response->getStatusCode() === 200;
33
+		} catch (Exception $e) {
34
+			return \false;
35
+		}
36
+	}
37
+	public function getClient() : ClientInterface
38
+	{
39
+		if (empty($this->client)) {
40
+			$this->client = Psr18ClientDiscovery::find();
41
+		}
42
+		return $this->client;
43
+	}
44
+	public function getRequestFactory() : RequestFactoryInterface
45
+	{
46
+		if (empty($this->requestFactory)) {
47
+			$this->requestFactory = Psr17FactoryDiscovery::findRequestFactory();
48
+		}
49
+		return $this->requestFactory;
50
+	}
51 51
 }
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\Transport\NodePool\Resurrect;
16 16
 
17 17
 use OCA\FullTextSearch_Elasticsearch\Vendor\Elastic\Transport\NodePool\Node;
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
 use OCA\FullTextSearch_Elasticsearch\Vendor\Http\Discovery\Psr17FactoryDiscovery;
21 21
 use OCA\FullTextSearch_Elasticsearch\Vendor\Http\Discovery\Psr18ClientDiscovery;
22 22
 use OCA\FullTextSearch_Elasticsearch\Vendor\Psr\Http\Message\RequestFactoryInterface;
23
-class ElasticsearchResurrect implements ResurrectInterface
24
-{
23
+class ElasticsearchResurrect implements ResurrectInterface {
25 24
     protected ClientInterface $client;
26 25
     protected RequestFactoryInterface $requestFactory;
27 26
     public function ping(Node $node) : bool
Please login to merge, or discard this patch.