private function createClass($method) { $class = $this->formatClass($method); if (!class_exists($class)) { throw new \BadMethodCallException(); } return new $class(); }