File tree 2 files changed +13
-3
lines changed
2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change 11
11
12
12
namespace ONGR \ElasticsearchBundle \Mapping ;
13
13
14
- use Doctrine \Common \Inflector \Inflector ;
14
+ use Doctrine \Inflector \Inflector ;
15
+ use Doctrine \Inflector \InflectorFactory ;
15
16
16
17
/**
17
18
* Utility for string case transformations.
18
19
*/
19
20
class Caser
20
21
{
22
+ /**
23
+ * @var Inflector|null
24
+ */
25
+ private static $ inflector ;
26
+
21
27
/**
22
28
* Transforms string to camel case (e.g., resultString).
23
29
*
@@ -27,7 +33,11 @@ class Caser
27
33
*/
28
34
public static function camel ($ string )
29
35
{
30
- return Inflector::camelize ($ string );
36
+ if (!self ::$ inflector ) {
37
+ self ::$ inflector = InflectorFactory::create ()->build ();
38
+ }
39
+
40
+ return self ::$ inflector ->camelize ($ string );
31
41
}
32
42
33
43
/**
Original file line number Diff line number Diff line change 22
22
"symfony/property-access" : " ^4.4|^5.0" ,
23
23
"doctrine/annotations" : " ^1.6" ,
24
24
"doctrine/cache" : " ^1.7" ,
25
- "doctrine/inflector" : " ^1.3 " ,
25
+ "doctrine/inflector" : " ^1.4 || ^2.0 " ,
26
26
"doctrine/collections" : " ^1.5" ,
27
27
"monolog/monolog" : " ^1.24" ,
28
28
"elasticsearch/elasticsearch" : " ^6.0" ,
You can’t perform that action at this time.
0 commit comments