File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed
Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change 1111
1212namespace ONGR \ElasticsearchBundle \Mapping ;
1313
14- use Doctrine \Common \Inflector \Inflector ;
14+ use Doctrine \Inflector \Inflector ;
15+ use Doctrine \Inflector \InflectorFactory ;
1516
1617/**
1718 * Utility for string case transformations.
1819 */
1920class Caser
2021{
22+ /**
23+ * @var Inflector|null
24+ */
25+ private static $ inflector ;
26+
2127 /**
2228 * Transforms string to camel case (e.g., resultString).
2329 *
@@ -27,7 +33,11 @@ class Caser
2733 */
2834 public static function camel ($ string )
2935 {
30- return Inflector::camelize ($ string );
36+ if (!self ::$ inflector ) {
37+ self ::$ inflector = InflectorFactory::create ()->build ();
38+ }
39+
40+ return self ::$ inflector ->camelize ($ string );
3141 }
3242
3343 /**
Original file line number Diff line number Diff line change 2222 "symfony/property-access" : " ^4.4|^5.0" ,
2323 "doctrine/annotations" : " ^1.6" ,
2424 "doctrine/cache" : " ^1.7" ,
25- "doctrine/inflector" : " ^1.3 " ,
25+ "doctrine/inflector" : " ^1.4 || ^2.0 " ,
2626 "doctrine/collections" : " ^1.5" ,
2727 "monolog/monolog" : " ^1.24" ,
2828 "elasticsearch/elasticsearch" : " ^6.0" ,
You can’t perform that action at this time.
0 commit comments