I\'m trying to use PHP reflection to dynamically load the class files of models automatically based upon the type of parameter that is in the controller method. Here\'s an e
class Foo {}
class Bar {}
class MyClass
{
public function baz(Foo $foo, Bar $bar) {}
}
$class = new ReflectionClass('MyClass');
$method = $class->getMethod('baz');
$params = $method->getParameters();
var_dump(
'Foo' === (string) $params[0]->getType()
);