public function setReflectionMethodFactory(\closure $factory = null) { $this->reflectionMethodFactory = $factory ?: function ($class, $method) { return new \reflectionMethod($class, $method); }; return $this; }