Skip to content

Commit d7449f6

Browse files
authored
Merge pull request #8522 from kenjis/fix-docs-RendererInterface
docs: add missing null to @param to RendererInterface
2 parents fab5398 + d434b8f commit d7449f6

File tree

3 files changed

+20
-19
lines changed

3 files changed

+20
-19
lines changed

system/View/Parser.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,9 @@ public function renderString(string $template, ?array $options = null, ?bool $sa
185185
* so that the variable is correctly handled within the
186186
* parsing itself, and contexts (including raw) are respected.
187187
*
188-
* @param non-empty-string|null $context The context to escape it for: html, css, js, url, raw
189-
* If 'raw', no escaping will happen
188+
* @param non-empty-string|null $context The context to escape it for.
189+
* If 'raw', no escaping will happen.
190+
* @phpstan-param null|'html'|'js'|'css'|'url'|'attr'|'raw' $context
190191
*/
191192
public function setData(array $data = [], ?string $context = null): RendererInterface
192193
{

system/View/RendererInterface.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,30 +22,30 @@ interface RendererInterface
2222
* Builds the output based upon a file name and any
2323
* data that has already been set.
2424
*
25-
* @param array $options Reserved for 3rd-party uses since
26-
* it might be needed to pass additional info
27-
* to other template engines.
28-
* @param bool $saveData Whether to save data for subsequent calls
25+
* @param array|null $options Reserved for 3rd-party uses since
26+
* it might be needed to pass additional info
27+
* to other template engines.
28+
* @param bool $saveData Whether to save data for subsequent calls
2929
*/
3030
public function render(string $view, ?array $options = null, bool $saveData = false): string;
3131

3232
/**
3333
* Builds the output based upon a string and any
3434
* data that has already been set.
3535
*
36-
* @param string $view The view contents
37-
* @param array $options Reserved for 3rd-party uses since
38-
* it might be needed to pass additional info
39-
* to other template engines.
40-
* @param bool $saveData Whether to save data for subsequent calls
36+
* @param string $view The view contents
37+
* @param array|null $options Reserved for 3rd-party uses since
38+
* it might be needed to pass additional info
39+
* to other template engines.
40+
* @param bool $saveData Whether to save data for subsequent calls
4141
*/
4242
public function renderString(string $view, ?array $options = null, bool $saveData = false): string;
4343

4444
/**
4545
* Sets several pieces of view data at once.
4646
*
47-
* @param string $context The context to escape it for: html, css, js, url
48-
* If 'raw', no escaping will happen
47+
* @param non-empty-string|null $context The context to escape it for.
48+
* If 'raw', no escaping will happen.
4949
* @phpstan-param null|'html'|'js'|'css'|'url'|'attr'|'raw' $context
5050
*
5151
* @return RendererInterface
@@ -56,8 +56,8 @@ public function setData(array $data = [], ?string $context = null);
5656
* Sets a single piece of view data.
5757
*
5858
* @param mixed $value
59-
* @param string $context The context to escape it for: html, css, js, url
60-
* If 'raw' no escaping will happen
59+
* @param non-empty-string|null $context The context to escape it for.
60+
* If 'raw', no escaping will happen.
6161
* @phpstan-param null|'html'|'js'|'css'|'url'|'attr'|'raw' $context
6262
*
6363
* @return RendererInterface

system/View/View.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -330,8 +330,8 @@ public function excerpt(string $string, int $length = 20): string
330330
/**
331331
* Sets several pieces of view data at once.
332332
*
333-
* @param string|null $context The context to escape it for: html, css, js, url
334-
* If null, no escaping will happen
333+
* @param non-empty-string|null $context The context to escape it for.
334+
* If 'raw', no escaping will happen.
335335
* @phpstan-param null|'html'|'js'|'css'|'url'|'attr'|'raw' $context
336336
*/
337337
public function setData(array $data = [], ?string $context = null): RendererInterface
@@ -350,8 +350,8 @@ public function setData(array $data = [], ?string $context = null): RendererInte
350350
* Sets a single piece of view data.
351351
*
352352
* @param mixed $value
353-
* @param string|null $context The context to escape it for: html, css, js, url
354-
* If null, no escaping will happen
353+
* @param non-empty-string|null $context The context to escape it for.
354+
* If 'raw', no escaping will happen.
355355
* @phpstan-param null|'html'|'js'|'css'|'url'|'attr'|'raw' $context
356356
*/
357357
public function setVar(string $name, $value = null, ?string $context = null): RendererInterface

0 commit comments

Comments
 (0)