Skip to content

Commit

Permalink
Fixed CS issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ezimuel committed Aug 14, 2020
1 parent 977b3ed commit cb6b628
Show file tree
Hide file tree
Showing 466 changed files with 7,309 additions and 3,648 deletions.
176 changes: 90 additions & 86 deletions src/Elasticsearch/Client.php

Large diffs are not rendered by default.

38 changes: 21 additions & 17 deletions src/Elasticsearch/ClientBuilder.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
<?php
/**
* Elasticsearch PHP client
*
* @link https://github.com/elastic/elasticsearch-php/
* @copyright Copyright (c) Elasticsearch B.V (https://www.elastic.co)
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license https://www.gnu.org/licenses/lgpl-2.1.html GNU Lesser General Public License, Version 2.1
*
* Licensed to Elasticsearch B.V under one or more agreements.
* Elasticsearch B.V licenses this file to you under the Apache 2.0 License or
* the GNU Lesser General Public License, Version 2.1, at your option.
* See the LICENSE file in the project root for more information.
*/


declare(strict_types = 1);

Expand All @@ -25,15 +39,6 @@
use Psr\Log\LoggerInterface;
use Psr\Log\NullLogger;

/**
* Class ClientBuilder
*
* @category Elasticsearch
* @package Elasticsearch\Common\Exceptions
* @author Zachary Tong <[email protected]>
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache2
* @link http://elastic.co
*/
class ClientBuilder
{
/**
Expand Down Expand Up @@ -129,7 +134,7 @@ class ClientBuilder
private $sslVerification = null;

/**
* @var bool
* @var bool
*/
private $includePortInHostHeader = false;

Expand Down Expand Up @@ -340,8 +345,6 @@ public function setHosts(array $hosts): ClientBuilder
/**
* Set the APIKey Pair, consiting of the API Id and the ApiKey of the Response from /_security/api_key
*
* @link https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-api-key.html
*
* @throws AuthenticationConfigException
*/
public function setApiKey(string $id, string $apiKey): ClientBuilder
Expand Down Expand Up @@ -386,20 +389,20 @@ public function setBasicAuthentication(string $username, string $password): Clie
/**
* Set Elastic Cloud ID to connect to Elastic Cloud
*
* @link https://elastic.co/cloud
*
* @param string $cloudId
*/
public function setElasticCloudId(string $cloudId): ClientBuilder
{
// Register the Hosts array
$this->setHosts([
$this->setHosts(
[
[
'host' => $this->parseElasticCloudId($cloudId),
'port' => '',
'scheme' => 'https',
]
]);
]
);

if (!isset($this->connectionParams['client']['curl'][CURLOPT_ENCODING])) {
// Merge best practices for the connection (enable gzip)
Expand Down Expand Up @@ -461,7 +464,7 @@ public function setSSLKey(string $key, string $password = null): ClientBuilder
}

/**
* @param bool|string $value
* @param bool|string $value
*/
public function setSSLVerification($value = true): ClientBuilder
{
Expand All @@ -472,6 +475,7 @@ public function setSSLVerification($value = true): ClientBuilder

/**
* Include the port in Host header
*
* @see https://github.com/elastic/elasticsearch-php/issues/993
*/
public function includePortInHostHeader(bool $enable): ClientBuilder
Expand Down
20 changes: 14 additions & 6 deletions src/Elasticsearch/Common/EmptyLogger.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
<?php
/**
* Elasticsearch PHP client
*
* @link https://github.com/elastic/elasticsearch-php/
* @copyright Copyright (c) Elasticsearch B.V (https://www.elastic.co)
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license https://www.gnu.org/licenses/lgpl-2.1.html GNU Lesser General Public License, Version 2.1
*
* Licensed to Elasticsearch B.V under one or more agreements.
* Elasticsearch B.V licenses this file to you under the Apache 2.0 License or
* the GNU Lesser General Public License, Version 2.1, at your option.
* See the LICENSE file in the project root for more information.
*/


declare(strict_types = 1);

Expand All @@ -12,12 +26,6 @@
*
* Logger that doesn't do anything. Similar to Monolog's NullHandler,
* but avoids the overhead of partially loading Monolog
*
* @category Elasticsearch
* @package Elasticsearch\Common
* @author Zachary Tong <[email protected]>
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache2
* @link http://elastic.co
*/
class EmptyLogger extends AbstractLogger implements LoggerInterface
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
<?php
/**
* Elasticsearch PHP client
*
* @link https://github.com/elastic/elasticsearch-php/
* @copyright Copyright (c) Elasticsearch B.V (https://www.elastic.co)
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license https://www.gnu.org/licenses/lgpl-2.1.html GNU Lesser General Public License, Version 2.1
*
* Licensed to Elasticsearch B.V under one or more agreements.
* Elasticsearch B.V licenses this file to you under the Apache 2.0 License or
* the GNU Lesser General Public License, Version 2.1, at your option.
* See the LICENSE file in the project root for more information.
*/

declare(strict_types = 1);

// Licensed to Elasticsearch B.V under one or more agreements.
Expand All @@ -7,15 +21,6 @@

namespace Elasticsearch\Common\Exceptions;

/**
* AuthenticationConfigException
*
* @category Elasticsearch
* @package Elasticsearch\Common\Exceptions
* @author Philip Krauss <[email protected]>
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache2
* @link http://elastic.co
*/
class AuthenticationConfigException extends \RuntimeException implements ElasticsearchException
{
}
20 changes: 14 additions & 6 deletions src/Elasticsearch/Common/Exceptions/BadMethodCallException.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
<?php
/**
* Elasticsearch PHP client
*
* @link https://github.com/elastic/elasticsearch-php/
* @copyright Copyright (c) Elasticsearch B.V (https://www.elastic.co)
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license https://www.gnu.org/licenses/lgpl-2.1.html GNU Lesser General Public License, Version 2.1
*
* Licensed to Elasticsearch B.V under one or more agreements.
* Elasticsearch B.V licenses this file to you under the Apache 2.0 License or
* the GNU Lesser General Public License, Version 2.1, at your option.
* See the LICENSE file in the project root for more information.
*/


declare(strict_types = 1);

Expand All @@ -8,12 +22,6 @@
* BadMethodCallException
*
* Denote problems with a method call (e.g. incorrect number of arguments)
*
* @category Elasticsearch
* @package Elasticsearch\Common\Exceptions
* @author Zachary Tong <[email protected]>
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache2
* @link http://elastic.co
*/
class BadMethodCallException extends \BadMethodCallException implements ElasticsearchException
{
Expand Down
23 changes: 14 additions & 9 deletions src/Elasticsearch/Common/Exceptions/BadRequest400Exception.php
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
<?php
/**
* Elasticsearch PHP client
*
* @link https://github.com/elastic/elasticsearch-php/
* @copyright Copyright (c) Elasticsearch B.V (https://www.elastic.co)
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license https://www.gnu.org/licenses/lgpl-2.1.html GNU Lesser General Public License, Version 2.1
*
* Licensed to Elasticsearch B.V under one or more agreements.
* Elasticsearch B.V licenses this file to you under the Apache 2.0 License or
* the GNU Lesser General Public License, Version 2.1, at your option.
* See the LICENSE file in the project root for more information.
*/


declare(strict_types = 1);

namespace Elasticsearch\Common\Exceptions;

/**
* BadRequest400Exception, thrown on 400 conflict http error
*
* @category Elasticsearch
* @package Elasticsearch\Common\Exceptions
* @author Zachary Tong <[email protected]>
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache2
* @link http://elastic.co
*/
class BadRequest400Exception extends \Exception implements ElasticsearchException
{
}
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
<?php
/**
* Elasticsearch PHP client
*
* @link https://github.com/elastic/elasticsearch-php/
* @copyright Copyright (c) Elasticsearch B.V (https://www.elastic.co)
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license https://www.gnu.org/licenses/lgpl-2.1.html GNU Lesser General Public License, Version 2.1
*
* Licensed to Elasticsearch B.V under one or more agreements.
* Elasticsearch B.V licenses this file to you under the Apache 2.0 License or
* the GNU Lesser General Public License, Version 2.1, at your option.
* See the LICENSE file in the project root for more information.
*/


declare(strict_types = 1);

namespace Elasticsearch\Common\Exceptions;

/**
* Class ClientErrorResponseException
*
* @category Elasticsearch
* @package Elasticsearch\Common\Exceptions
* @author Zachary Tong <[email protected]>
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache2
* @link http://elastic.co
*/
class ClientErrorResponseException extends TransportException implements ElasticsearchException
{
}
23 changes: 14 additions & 9 deletions src/Elasticsearch/Common/Exceptions/Conflict409Exception.php
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
<?php
/**
* Elasticsearch PHP client
*
* @link https://github.com/elastic/elasticsearch-php/
* @copyright Copyright (c) Elasticsearch B.V (https://www.elastic.co)
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license https://www.gnu.org/licenses/lgpl-2.1.html GNU Lesser General Public License, Version 2.1
*
* Licensed to Elasticsearch B.V under one or more agreements.
* Elasticsearch B.V licenses this file to you under the Apache 2.0 License or
* the GNU Lesser General Public License, Version 2.1, at your option.
* See the LICENSE file in the project root for more information.
*/


declare(strict_types = 1);

namespace Elasticsearch\Common\Exceptions;

/**
* Conflict409Exception, thrown on 409 conflict http error
*
* @category Elasticsearch
* @package Elasticsearch\Common\Exceptions
* @author Zachary Tong <[email protected]>
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache2
* @link http://elastic.co
*/
class Conflict409Exception extends \Exception implements ElasticsearchException
{
}
23 changes: 14 additions & 9 deletions src/Elasticsearch/Common/Exceptions/Curl/CouldNotConnectToHost.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
<?php
/**
* Elasticsearch PHP client
*
* @link https://github.com/elastic/elasticsearch-php/
* @copyright Copyright (c) Elasticsearch B.V (https://www.elastic.co)
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license https://www.gnu.org/licenses/lgpl-2.1.html GNU Lesser General Public License, Version 2.1
*
* Licensed to Elasticsearch B.V under one or more agreements.
* Elasticsearch B.V licenses this file to you under the Apache 2.0 License or
* the GNU Lesser General Public License, Version 2.1, at your option.
* See the LICENSE file in the project root for more information.
*/


declare(strict_types = 1);

Expand All @@ -7,15 +21,6 @@
use Elasticsearch\Common\Exceptions\ElasticsearchException;
use Elasticsearch\Common\Exceptions\TransportException;

/**
* Class CouldNotConnectToHost
*
* @category Elasticsearch
* @package Elasticsearch\Common\Exceptions\Curl
* @author Zachary Tong <[email protected]>
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache2
* @link http://elastic.co
*/
class CouldNotConnectToHost extends TransportException implements ElasticsearchException
{
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
<?php
/**
* Elasticsearch PHP client
*
* @link https://github.com/elastic/elasticsearch-php/
* @copyright Copyright (c) Elasticsearch B.V (https://www.elastic.co)
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license https://www.gnu.org/licenses/lgpl-2.1.html GNU Lesser General Public License, Version 2.1
*
* Licensed to Elasticsearch B.V under one or more agreements.
* Elasticsearch B.V licenses this file to you under the Apache 2.0 License or
* the GNU Lesser General Public License, Version 2.1, at your option.
* See the LICENSE file in the project root for more information.
*/


declare(strict_types = 1);

Expand All @@ -7,15 +21,6 @@
use Elasticsearch\Common\Exceptions\ElasticsearchException;
use Elasticsearch\Common\Exceptions\TransportException;

/**
* Class CouldNotResolveHostException
*
* @category Elasticsearch
* @package Elasticsearch\Common\Exceptions\Curl
* @author Zachary Tong <[email protected]>
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache2
* @link http://elastic.co
*/
class CouldNotResolveHostException extends TransportException implements ElasticsearchException
{
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
<?php
/**
* Elasticsearch PHP client
*
* @link https://github.com/elastic/elasticsearch-php/
* @copyright Copyright (c) Elasticsearch B.V (https://www.elastic.co)
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license https://www.gnu.org/licenses/lgpl-2.1.html GNU Lesser General Public License, Version 2.1
*
* Licensed to Elasticsearch B.V under one or more agreements.
* Elasticsearch B.V licenses this file to you under the Apache 2.0 License or
* the GNU Lesser General Public License, Version 2.1, at your option.
* See the LICENSE file in the project root for more information.
*/


declare(strict_types = 1);

Expand All @@ -7,15 +21,6 @@
use Elasticsearch\Common\Exceptions\ElasticsearchException;
use Elasticsearch\Common\Exceptions\TransportException;

/**
* Class OperationTimeoutException
*
* @category Elasticsearch
* @package Elasticsearch\Common\Exceptions\Curl
* @author Zachary Tong <[email protected]>
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache2
* @link http://elastic.co
*/
class OperationTimeoutException extends TransportException implements ElasticsearchException
{
}
Loading

0 comments on commit cb6b628

Please sign in to comment.