I've custom code where I run class methods:
$object = new UserClass();
$method = 'create';
$params = ['name' => 'John'];
$reflectionMethod = new \ReflectionMethod($object, $method);
if($reflectionMethod->isStatic()) {
return $object::$method($params);
} else {
return $object->$method($params);
}
How I can run class method without checking if the method type is static or not, with one line if possible?