Skip to content

Commit 2b0c7d0

Browse files
Add compatibility to different symfony versions (#3)
1 parent aebcc24 commit 2b0c7d0

11 files changed

+41
-18
lines changed

.travis.yml

+28-4
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,46 @@
11
sudo: false
22
language: php
3-
php:
4-
- 7.2
5-
- 7.3
6-
- 7.4
3+
4+
matrix:
5+
include:
6+
- language: php
7+
php: 7.1
8+
env:
9+
- SYMFONY=^2.8
10+
11+
- language: php
12+
php: 7.2
13+
env:
14+
- SYMFONY=^3.4
15+
16+
- language: php
17+
php: 7.3
18+
env:
19+
- SYMFONY=^4.4
20+
21+
- language: php
22+
php: 7.4
23+
env:
24+
- SYMFONY=^5.0
25+
726
env:
827
global:
928
- ES_VERSION=6.8.2 ES_DOWNLOAD_URL=https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-${ES_VERSION}.tar.gz
29+
1030
install:
1131
- wget ${ES_DOWNLOAD_URL}
1232
- tar -xzf elasticsearch-${ES_VERSION}.tar.gz
1333
- ./elasticsearch-${ES_VERSION}/bin/elasticsearch -d
34+
1435
before_script:
1536
- if [ "$GITHUB_COMPOSER_AUTH" ]; then composer config -g github-oauth.github.com $GITHUB_COMPOSER_AUTH; fi
37+
- composer require --no-update symfony/symfony:${SYMFONY}
1638
- composer install --no-interaction --prefer-dist
39+
1740
script:
1841
- wget -q --waitretry=1 --retry-connrefused -T 10 -O - http://127.0.0.1:9200
1942
- vendor/bin/phpunit --coverage-clover=coverage.xml
2043
- vendor/bin/phpcs -p --standard=PSR2 --ignore=vendor/ ./
44+
2145
after_script:
2246
- travis_retry bash <(curl -s https://codecov.io/bash)

composer.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111
}
1212
],
1313
"require": {
14-
"php": "^7.2",
15-
"symfony/serializer": "^5.0",
14+
"php": "^7.1",
15+
"symfony/serializer": "^2.8 || ^3.4 || ^4.0 || ^5.0",
1616
"paragonie/random_compat": "*",
1717
"elasticsearch/elasticsearch": "^6.0"
1818
},
1919
"require-dev": {
20-
"phpunit/phpunit": "^7.0",
21-
"squizlabs/php_codesniffer": "^3.0"
20+
"phpunit/phpunit": "^5.7.26 || ^7.5.20",
21+
"squizlabs/php_codesniffer": "^2.0 || ^3.0"
2222
},
2323
"suggest": {
2424
"elasticsearch/elasticsearch": "This library is for elasticsearch/elasticsearch client to enhance it with DSL functionality."

phpunit.xml.dist

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
convertWarningsToExceptions="true"
99
processIsolation="false"
1010
stopOnFailure="false"
11-
syntaxCheck="false"
1211
bootstrap="vendor/autoload.php">
1312

1413
<testsuites>

src/SearchEndpoint/AggregationsEndpoint.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class AggregationsEndpoint extends AbstractSearchEndpoint
2727
/**
2828
* {@inheritdoc}
2929
*/
30-
public function normalize(NormalizerInterface $normalizer, string $format = null, array $context = [])
30+
public function normalize(NormalizerInterface $normalizer, $format = null, array $context = [])
3131
{
3232
$output = [];
3333
if (count($this->getAll()) > 0) {

src/SearchEndpoint/HighlightEndpoint.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class HighlightEndpoint extends AbstractSearchEndpoint
3737
/**
3838
* {@inheritdoc}
3939
*/
40-
public function normalize(NormalizerInterface $normalizer, string $format = null, array $context = [])
40+
public function normalize(NormalizerInterface $normalizer, $format = null, array $context = [])
4141
{
4242
if ($this->highlight) {
4343
return $this->highlight->toArray();

src/SearchEndpoint/InnerHitsEndpoint.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class InnerHitsEndpoint extends AbstractSearchEndpoint
2727
/**
2828
* {@inheritdoc}
2929
*/
30-
public function normalize(NormalizerInterface $normalizer, string $format = null, array $context = [])
30+
public function normalize(NormalizerInterface $normalizer, $format = null, array $context = [])
3131
{
3232
$output = [];
3333
if (count($this->getAll()) > 0) {

src/SearchEndpoint/PostFilterEndpoint.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class PostFilterEndpoint extends QueryEndpoint
2626
/**
2727
* {@inheritdoc}
2828
*/
29-
public function normalize(NormalizerInterface $normalizer, string $format = null, array $context = [])
29+
public function normalize(NormalizerInterface $normalizer, $format = null, array $context = [])
3030
{
3131
if (!$this->getBool()) {
3232
return null;

src/SearchEndpoint/QueryEndpoint.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class QueryEndpoint extends AbstractSearchEndpoint implements OrderedNormalizerI
3939
/**
4040
* {@inheritdoc}
4141
*/
42-
public function normalize(NormalizerInterface $normalizer, string $format = null, array $context = [])
42+
public function normalize(NormalizerInterface $normalizer, $format = null, array $context = [])
4343
{
4444
if (!$this->filtersSet && $this->hasReference('filter_query')) {
4545
/** @var BuilderInterface $filter */

src/SearchEndpoint/SortEndpoint.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class SortEndpoint extends AbstractSearchEndpoint
2626
/**
2727
* {@inheritdoc}
2828
*/
29-
public function normalize(NormalizerInterface $normalizer, string $format = null, array $context = [])
29+
public function normalize(NormalizerInterface $normalizer, $format = null, array $context = [])
3030
{
3131
$output = [];
3232

src/SearchEndpoint/SuggestEndpoint.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class SuggestEndpoint extends AbstractSearchEndpoint
2727
/**
2828
* {@inheritdoc}
2929
*/
30-
public function normalize(NormalizerInterface $normalizer, string $format = null, array $context = [])
30+
public function normalize(NormalizerInterface $normalizer, $format = null, array $context = [])
3131
{
3232
$output = [];
3333
if (count($this->getAll()) > 0) {

src/Serializer/Normalizer/CustomReferencedNormalizer.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class CustomReferencedNormalizer extends CustomNormalizer
2626
/**
2727
* {@inheritdoc}
2828
*/
29-
public function normalize($object, string $format = null, array $context = [])
29+
public function normalize($object, $format = null, array $context = [])
3030
{
3131
$object->setReferences($this->references);
3232
$data = parent::normalize($object, $format, $context);
@@ -38,7 +38,7 @@ public function normalize($object, string $format = null, array $context = [])
3838
/**
3939
* {@inheritdoc}
4040
*/
41-
public function supportsNormalization($data, string $format = null)
41+
public function supportsNormalization($data, $format = null)
4242
{
4343
return $data instanceof AbstractNormalizable;
4444
}

0 commit comments

Comments
 (0)