Skip to content

Commit 319676c

Browse files
Merge branch 'develop-jordan' into develop-4.3-jordan
2 parents 55bb88d + 55dd433 commit 319676c

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

app/sprinkles/core/src/Util/ClassMapper.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,7 @@ public function createInstance($identifier)
3737

3838
$params = array_slice(func_get_args(), 1);
3939

40-
// We must use reflection in PHP < 5.6. See http://stackoverflow.com/questions/8734522/dynamically-call-class-with-variable-number-of-parameters-in-the-constructor
41-
$reflection = new \ReflectionClass($className);
42-
43-
return $reflection->newInstanceArgs($params);
40+
return new $className(...$params);
4441
}
4542

4643
/**
@@ -90,6 +87,6 @@ public function staticMethod($identifier, $methodName)
9087

9188
$params = array_slice(func_get_args(), 2);
9289

93-
return call_user_func_array("$className::$methodName", $params);
90+
return $className::$methodName(...$params);
9491
}
9592
}

0 commit comments

Comments
 (0)