diff --git a/system/View/Parser.php b/system/View/Parser.php index 87f0e96bdce9..ff5656a53863 100644 --- a/system/View/Parser.php +++ b/system/View/Parser.php @@ -185,8 +185,9 @@ public function renderString(string $template, ?array $options = null, ?bool $sa * so that the variable is correctly handled within the * parsing itself, and contexts (including raw) are respected. * - * @param non-empty-string|null $context The context to escape it for: html, css, js, url, raw - * If 'raw', no escaping will happen + * @param non-empty-string|null $context The context to escape it for. + * If 'raw', no escaping will happen. + * @phpstan-param null|'html'|'js'|'css'|'url'|'attr'|'raw' $context */ public function setData(array $data = [], ?string $context = null): RendererInterface { diff --git a/system/View/RendererInterface.php b/system/View/RendererInterface.php index 4bb889743f9f..c4edeb9550f4 100644 --- a/system/View/RendererInterface.php +++ b/system/View/RendererInterface.php @@ -22,10 +22,10 @@ interface RendererInterface * Builds the output based upon a file name and any * data that has already been set. * - * @param array $options Reserved for 3rd-party uses since - * it might be needed to pass additional info - * to other template engines. - * @param bool $saveData Whether to save data for subsequent calls + * @param array|null $options Reserved for 3rd-party uses since + * it might be needed to pass additional info + * to other template engines. + * @param bool $saveData Whether to save data for subsequent calls */ public function render(string $view, ?array $options = null, bool $saveData = false): string; @@ -33,19 +33,19 @@ public function render(string $view, ?array $options = null, bool $saveData = fa * Builds the output based upon a string and any * data that has already been set. * - * @param string $view The view contents - * @param array $options Reserved for 3rd-party uses since - * it might be needed to pass additional info - * to other template engines. - * @param bool $saveData Whether to save data for subsequent calls + * @param string $view The view contents + * @param array|null $options Reserved for 3rd-party uses since + * it might be needed to pass additional info + * to other template engines. + * @param bool $saveData Whether to save data for subsequent calls */ public function renderString(string $view, ?array $options = null, bool $saveData = false): string; /** * Sets several pieces of view data at once. * - * @param string $context The context to escape it for: html, css, js, url - * If 'raw', no escaping will happen + * @param non-empty-string|null $context The context to escape it for. + * If 'raw', no escaping will happen. * @phpstan-param null|'html'|'js'|'css'|'url'|'attr'|'raw' $context * * @return RendererInterface @@ -56,8 +56,8 @@ public function setData(array $data = [], ?string $context = null); * Sets a single piece of view data. * * @param mixed $value - * @param string $context The context to escape it for: html, css, js, url - * If 'raw' no escaping will happen + * @param non-empty-string|null $context The context to escape it for. + * If 'raw', no escaping will happen. * @phpstan-param null|'html'|'js'|'css'|'url'|'attr'|'raw' $context * * @return RendererInterface diff --git a/system/View/View.php b/system/View/View.php index 8940951a42aa..ad5c38de9b2f 100644 --- a/system/View/View.php +++ b/system/View/View.php @@ -330,8 +330,8 @@ public function excerpt(string $string, int $length = 20): string /** * Sets several pieces of view data at once. * - * @param string|null $context The context to escape it for: html, css, js, url - * If null, no escaping will happen + * @param non-empty-string|null $context The context to escape it for. + * If 'raw', no escaping will happen. * @phpstan-param null|'html'|'js'|'css'|'url'|'attr'|'raw' $context */ public function setData(array $data = [], ?string $context = null): RendererInterface @@ -350,8 +350,8 @@ public function setData(array $data = [], ?string $context = null): RendererInte * Sets a single piece of view data. * * @param mixed $value - * @param string|null $context The context to escape it for: html, css, js, url - * If null, no escaping will happen + * @param non-empty-string|null $context The context to escape it for. + * If 'raw', no escaping will happen. * @phpstan-param null|'html'|'js'|'css'|'url'|'attr'|'raw' $context */ public function setVar(string $name, $value = null, ?string $context = null): RendererInterface