From c861fcba2ca29404dc9e617eedd9eff4616986b8 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Fri, 20 Dec 2019 15:22:59 +0100 Subject: [PATCH] Fix indentation --- src/Monolog/Handler/ElasticsearchHandler.php | 56 ++++++++++---------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/src/Monolog/Handler/ElasticsearchHandler.php b/src/Monolog/Handler/ElasticsearchHandler.php index 64a285e9..7a7ef059 100644 --- a/src/Monolog/Handler/ElasticsearchHandler.php +++ b/src/Monolog/Handler/ElasticsearchHandler.php @@ -155,35 +155,35 @@ class ElasticsearchHandler extends AbstractProcessingHandler throw new RuntimeException('Error sending messages to Elasticsearch', 0, $e); } } - } - - /** - * Creates elasticsearch exception from responses array - * - * Only the first error is converted into an exception. - * - * @param array $responses returned by $this->client->bulk() - */ - protected function createExceptionFromResponses(array $responses): ElasticsearchRuntimeException - { - foreach ($responses['items'] ?? [] as $item) { - if (isset($item['index']['error'])) { - return $this->createExceptionFromError($item['index']['error']); - } - } + } - return new ElasticsearchRuntimeException('Elasticsearch failed to index one or more records.'); - } + /** + * Creates elasticsearch exception from responses array + * + * Only the first error is converted into an exception. + * + * @param array $responses returned by $this->client->bulk() + */ + protected function createExceptionFromResponses(array $responses): ElasticsearchRuntimeException + { + foreach ($responses['items'] ?? [] as $item) { + if (isset($item['index']['error'])) { + return $this->createExceptionFromError($item['index']['error']); + } + } - /** - * Creates elasticsearch exception from error array - * - * @param array $error - */ - protected function createExceptionFromError(array $error): ElasticsearchRuntimeException - { - $previous = isset($error['caused_by']) ? $this->createExceptionFromError($error['caused_by']) : null; + return new ElasticsearchRuntimeException('Elasticsearch failed to index one or more records.'); + } - return new ElasticsearchRuntimeException($error['type'] . ': ' . $error['reason'], 0, $previous); - } + /** + * Creates elasticsearch exception from error array + * + * @param array $error + */ + protected function createExceptionFromError(array $error): ElasticsearchRuntimeException + { + $previous = isset($error['caused_by']) ? $this->createExceptionFromError($error['caused_by']) : null; + + return new ElasticsearchRuntimeException($error['type'] . ': ' . $error['reason'], 0, $previous); + } }