1
0
mirror of https://github.com/danielstjules/Stringy.git synced 2025-08-09 06:46:40 +02:00

PHP 5.3 support with reflection

This commit is contained in:
Daniel St. Jules
2015-12-20 11:35:48 -08:00
parent 3c7bc662a6
commit ee59d586f2

View File

@@ -30,11 +30,12 @@ class StaticStringy
public static function __callStatic($name, $arguments)
{
if (!static::$methodArgs) {
$methods = (new \ReflectionClass('Stringy\Stringy'))->getMethods(\ReflectionMethod::IS_PUBLIC);
$stringyClass = new \ReflectionClass('Stringy\Stringy');
$methods = $stringyClass->getMethods(\ReflectionMethod::IS_PUBLIC);
foreach ($methods as $method) {
/** @var \ReflectionMethod $method */
static::$methodArgs[$method->name] = $method->getNumberOfParameters() + 2;
$params = $method->getNumberOfParameters() + 2;
static::$methodArgs[$method->name] = $params;
}
}