middlewareName = $middlewareName; return $instance; } public static function fromNull() { $instance = new self('Middleware name cannot be null'); return $instance; } /** * @return string */ public function toMiddlewareName() { return null !== $this->middlewareName ? $this->middlewareName : ''; } }