diff --git a/.coveralls.yml b/.coveralls.yml deleted file mode 100644 index fe82e42b..00000000 --- a/.coveralls.yml +++ /dev/null @@ -1,3 +0,0 @@ -coverage_clover: coveralls.clover -service_name: travis-ci -json_path: ./coveralls.json diff --git a/.travis.yml b/.travis.yml index d1efe231..b6afbb8c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ php: - 7.4 env: global: - - ES_VERSION=6.2.3 ES_DOWNLOAD_URL=https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-${ES_VERSION}.tar.gz + - ES_VERSION=6.8.2 ES_DOWNLOAD_URL=https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-${ES_VERSION}.tar.gz matrix: - SYMFONY="^4.4" - SYMFONY="^5.0" @@ -28,4 +28,4 @@ script: - vendor/bin/phpunit --coverage-clover=coverage.clover - vendor/bin/phpcs -p --standard=PSR2 --ignore=vendor/,Tests/app/,var/cache ./ after_script: - - travis_retry php vendor/bin/coveralls + - travis_retry bash <(curl -s https://codecov.io/bash) diff --git a/Mapping/Caser.php b/Mapping/Caser.php index 6a0022ae..073e0475 100644 --- a/Mapping/Caser.php +++ b/Mapping/Caser.php @@ -11,13 +11,19 @@ namespace ONGR\ElasticsearchBundle\Mapping; -use Doctrine\Common\Inflector\Inflector; +use Doctrine\Inflector\Inflector; +use Doctrine\Inflector\InflectorFactory; /** * Utility for string case transformations. */ class Caser { + /** + * @var Inflector|null + */ + private static $inflector; + /** * Transforms string to camel case (e.g., resultString). * @@ -27,7 +33,11 @@ class Caser */ public static function camel($string) { - return Inflector::camelize($string); + if (!self::$inflector) { + self::$inflector = InflectorFactory::create()->build(); + } + + return self::$inflector->camelize($string); } /** diff --git a/README.md b/README.md index 13157a8f..f3212f8c 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,7 @@ is the preferred and recommended way to ask questions about ONGR bundles and lib [![Build Status](https://travis-ci.org/ongr-io/ElasticsearchBundle.svg?branch=master)](https://travis-ci.org/ongr-io/ElasticsearchBundle) +[![codecov](https://codecov.io/gh/ongr-io/ElasticsearchBundle/branch/master/graph/badge.svg)](https://codecov.io/gh/ongr-io/ElasticsearchBundle) [![Latest Stable Version](https://poser.pugx.org/ongr/elasticsearch-bundle/v/stable)](https://packagist.org/packages/ongr/elasticsearch-bundle) [![Total Downloads](https://poser.pugx.org/ongr/elasticsearch-bundle/downloads)](https://packagist.org/packages/ongr/elasticsearch-bundle) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/ongr-io/ElasticsearchBundle/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/ongr-io/ElasticsearchBundle/?branch=master) diff --git a/composer.json b/composer.json index defe1790..62752e90 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ "symfony/property-access": "^4.4|^5.0", "doctrine/annotations": "^1.6", "doctrine/cache": "^1.7", - "doctrine/inflector": "^1.3", + "doctrine/inflector": "^1.4 || ^2.0", "doctrine/collections": "^1.5", "monolog/monolog": "^1.24", "elasticsearch/elasticsearch": "^6.0",