Skip to content

Commit

Permalink
Merge pull request #8522 from kenjis/fix-docs-RendererInterface
Browse files Browse the repository at this point in the history
docs: add missing null to @param to RendererInterface
  • Loading branch information
kenjis authored Feb 10, 2024
2 parents fab5398 + d434b8f commit d7449f6
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 19 deletions.
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

0 comments on commit d7449f6

Please sign in to comment.