Skip to content

Commit

Permalink
Merge pull request #8 from pechondra/3914-php8-match-keyword-2
Browse files Browse the repository at this point in the history
Remove `match` keyword from class names (atc.) for PHP8.0+ (for version-one breanch)
  • Loading branch information
Spamercz authored Sep 29, 2021
2 parents b730819 + 38ae634 commit 315d639
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion doc/01-usage.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Using with [ElasticSearch/ElasticSearch](https://github.com/elastic/elasticsearch-php)
First we need to prepare query for what we want to search.

```php
$query = new \Spameri\ElasticQuery\ElasticQuery();
$query->query()->must()->add(
new \Spameri\ElasticQuery\Query\Match(
new \Spameri\ElasticQuery\Query\ElasticMatch(
'name',
'Avengers'
)
Expand Down
2 changes: 1 addition & 1 deletion src/Query/Match.php → src/Query/ElasticMatch.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/**
* @see https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-match-query.html
*/
class Match implements \Spameri\ElasticQuery\Query\LeafQueryInterface
class ElasticMatch implements \Spameri\ElasticQuery\Query\LeafQueryInterface
{

private string $field;
Expand Down
2 changes: 1 addition & 1 deletion tests/SpameriTests/ElasticQuery/ElasticQuery.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class ElasticQuery extends \Tester\TestCase

public function testCreate() : void
{
$match = new \Spameri\ElasticQuery\Query\Match(
$match = new \Spameri\ElasticQuery\Query\ElasticMatch(
'name',
'Avengers',
1.0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace SpameriTests\ElasticQuery\Query;
require_once __DIR__ . '/../../bootstrap.php';


class Match extends \Tester\TestCase
class ElasticMatch extends \Tester\TestCase
{

private const INDEX = 'spameri_test_video_match';
Expand All @@ -26,7 +26,7 @@ class Match extends \Tester\TestCase

public function testCreate() : void
{
$match = new \Spameri\ElasticQuery\Query\Match(
$match = new \Spameri\ElasticQuery\Query\ElasticMatch(
'name',
'Avengers',
1.0,
Expand Down Expand Up @@ -101,4 +101,4 @@ class Match extends \Tester\TestCase

}

(new Match())->run();
(new ElasticMatch())->run();

0 comments on commit 315d639

Please sign in to comment.