From 2f3ba93a424efa6b30c48e098d7d20f1311866de Mon Sep 17 00:00:00 2001 From: devandrey Date: Fri, 26 Aug 2022 10:59:57 +0300 Subject: [PATCH] Up php version to 8.0. Add return types --- composer.json | 2 +- .../DSL/Query/ElasticSearchDSLFetchSourceContext.php | 2 +- src/CodeTool/ElasticSearch/ElasticSearchScript.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index f531895..6c39143 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ } }, "require": { - "php": "^7.4 || >=8.0", + "php": "^8.0", "ext-json": "*" }, "require-dev": { diff --git a/src/CodeTool/ElasticSearch/DSL/Query/ElasticSearchDSLFetchSourceContext.php b/src/CodeTool/ElasticSearch/DSL/Query/ElasticSearchDSLFetchSourceContext.php index 376f38b..7d0e278 100644 --- a/src/CodeTool/ElasticSearch/DSL/Query/ElasticSearchDSLFetchSourceContext.php +++ b/src/CodeTool/ElasticSearch/DSL/Query/ElasticSearchDSLFetchSourceContext.php @@ -57,7 +57,7 @@ public function excludes(string ...$excludes): self return $this; } - public function jsonSerialize() + public function jsonSerialize(): array|bool { if (false === $this->fetchSource) { return false; diff --git a/src/CodeTool/ElasticSearch/ElasticSearchScript.php b/src/CodeTool/ElasticSearch/ElasticSearchScript.php index 9c74a29..fa9ca9a 100644 --- a/src/CodeTool/ElasticSearch/ElasticSearchScript.php +++ b/src/CodeTool/ElasticSearch/ElasticSearchScript.php @@ -49,7 +49,7 @@ public function param(string $name, $value): self return $this; } - public function jsonSerialize() + public function jsonSerialize(): string|array { if ('' === $this->type && '' === $this->lang && [] === $this->params) { return $this->script;