mirror of
https://github.com/danielstjules/Stringy.git
synced 2025-08-11 07:44:12 +02:00
PHP 5.3 support with reflection
This commit is contained in:
@@ -30,11 +30,12 @@ class StaticStringy
|
|||||||
public static function __callStatic($name, $arguments)
|
public static function __callStatic($name, $arguments)
|
||||||
{
|
{
|
||||||
if (!static::$methodArgs) {
|
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) {
|
foreach ($methods as $method) {
|
||||||
/** @var \ReflectionMethod $method */
|
$params = $method->getNumberOfParameters() + 2;
|
||||||
static::$methodArgs[$method->name] = $method->getNumberOfParameters() + 2;
|
static::$methodArgs[$method->name] = $params;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user