Skip to content

docs: add missing null to @param to RendererInterface #8522

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions system/View/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
26 changes: 13 additions & 13 deletions system/View/RendererInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,30 +22,30 @@ 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;

/**
* 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
Expand All @@ -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
Expand Down
8 changes: 4 additions & 4 deletions system/View/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down