File tree Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 66 - ' 7.1'
77 - ' 7.2'
88 - ' 7.3'
9+ - ' 7.4'
910
1011before_script :
1112 - composer install --dev
Original file line number Diff line number Diff line change 1414 "require" : {
1515 "php" : " >=7.1" ,
1616 "guzzlehttp/guzzle" : " ~6.0" ,
17- "doctrine/inflector" : " ~1.0"
17+ "doctrine/inflector" : " ~1.0 || ~2.0 "
1818 },
1919 "require-dev" : {
20- "phpspec/phpspec" : " ~5.1" ,
20+ "phpspec/phpspec" : " ~5.1 || ~6.0 " ,
2121 "squizlabs/php_codesniffer" : " ^3.0"
2222 },
2323 "config" : {
Original file line number Diff line number Diff line change 33namespace Packagist \Api \Result ;
44
55use Doctrine \Common \Inflector \Inflector ;
6+ use Doctrine \Inflector \InflectorFactory ;
67
78abstract class AbstractResult
89{
@@ -11,8 +12,9 @@ abstract class AbstractResult
1112 */
1213 public function fromArray (array $ data )
1314 {
15+ $ inflector = \class_exists (InflectorFactory::class) ? InflectorFactory::create ()->build () : null ;
1416 foreach ($ data as $ key => $ value ) {
15- $ property = Inflector::camelize ($ key );
17+ $ property = null === $ inflector ? Inflector::camelize ( $ key ) : $ inflector -> camelize ($ key );
1618 $ this ->$ property = $ value ;
1719 }
1820 }
You can’t perform that action at this time.
0 commit comments