Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support PHP 8.0 #1794

Merged
merged 4 commits into from
Oct 20, 2020
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ matrix:
fast_finish: true
include:
- php: 7.3
env: RUN_TEST=true ES_VERSION=73
env: RUN_TEST=true ES_VERSION=73
- php: 7.4
env: RUN_TEST=true ES_VERSION=73
env: RUN_TEST=true ES_VERSION=73
- php: nightly
env: RUN_TEST=true ES_VERSION=73 COMPOSER_FLAGS="--ignore-platform-reqs"
# Testing the library with different ES versions
- php: 7.2
env: RUN_TEST=true ES_VERSION=72
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
}
],
"require": {
"php": "^7.2",
"php": "^7.2 || ^8.0",
"ext-json": "*",
"psr/log": "^1.0",
"elasticsearch/elasticsearch": "^7.1.1 !=7.4.0"
Expand Down
4 changes: 2 additions & 2 deletions tests/ClientConfigurationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ class ClientConfigurationTest extends TestCase
public function testInvalidDsn(): void
{
$this->expectException(\Elastica\Exception\InvalidException::class);
$this->expectExceptionMessage("DSN 'test:0' is invalid.");
$this->expectExceptionMessage("DSN ':0' is invalid.");

ClientConfiguration::fromDsn('test:0');
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since PHP 8.0 RC1 a 0 port number is considered valid: See php/php-src#6152
For details see how it behaves on other PHP versions: https://3v4l.org/ZYhJc

ClientConfiguration::fromDsn(':0');
}

public function testFromSimpleDsn(): void
Expand Down