0

I have this function:

public function createController()
{
    $valid_controller = class_exists($this->controllerClass)
                    &&  in_array("BaseController", class_parents($this->controllerClass));

    if($valid_controller)
    {
        return new $this->controllerClass($this->urlData["action"]);
    }
    else
    {
        $error = new ErrorController("badurl");
    }
}

and I want to create a DocBlock that describe it. This function returns a controller object only if the required controller is valid, and if not, it creates an instace of the ErrorController class, but does not return a value. How can I right a proper @return tag for this function?

Michael Haddad
  • 4,085
  • 7
  • 42
  • 82

1 Answers1

1

PHPDocumentor Docs say to use

@return  null|ControllerClass    text description or explanation here
Mark Baker
  • 209,507
  • 32
  • 346
  • 385