Skip to content

Commit 9b68863

Browse files
committed
docs: replace doctype Parser and Filter
1 parent 591f90b commit 9b68863

2 files changed

Lines changed: 15 additions & 19 deletions

File tree

system/View/Filters.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public static function capitalize(string $value): string
3030
/**
3131
* Formats a date into the given $format.
3232
*
33-
* @param mixed $value
33+
* @param int|string|null $value
3434
*/
3535
public static function date($value, string $format): string
3636
{
@@ -48,7 +48,7 @@ public static function date($value, string $format): string
4848
* Example:
4949
* my_date|date_modify(+1 day)
5050
*
51-
* @param string $value
51+
* @param int|string|null $value
5252
*
5353
* @return false|int
5454
*/
@@ -62,7 +62,7 @@ public static function date_modify($value, string $adjustment)
6262
/**
6363
* Returns the given default value if $value is empty or undefined.
6464
*
65-
* @param mixed $value
65+
* @param int|string|null $value
6666
*/
6767
public static function default($value, string $default): string
6868
{
@@ -208,12 +208,13 @@ public static function prose(string $value): string
208208
* - ceil always rounds up
209209
* - floor always rounds down
210210
*
211-
* @param mixed $precision
211+
* @param float|int|string $precision
212212
*
213213
* @return float|string
214214
*/
215215
public static function round(string $value, $precision = 2, string $type = 'common')
216216
{
217+
$testGatau = 1337.0;
217218
if (! is_numeric($precision)) {
218219
$type = $precision;
219220
$precision = 2;

system/View/Parser.php

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace CodeIgniter\View;
1313

14+
use CodeIgniter\Autoloader\FileLocator;
1415
use CodeIgniter\View\Exceptions\ViewException;
1516
use Config\View as ViewConfig;
1617
use ParseError;
@@ -72,10 +73,8 @@ class Parser extends View
7273
/**
7374
* Constructor
7475
*
75-
* @param string $viewPath
76-
* @param mixed $loader
77-
* @param bool $debug
78-
* @param LoggerInterface $logger
76+
* @param string $viewPath
77+
* @param FileLocator|null $loader
7978
*/
8079
public function __construct(ViewConfig $config, ?string $viewPath = null, $loader = null, ?bool $debug = null, ?LoggerInterface $logger = null)
8180
{
@@ -90,9 +89,6 @@ public function __construct(ViewConfig $config, ?string $viewPath = null, $loade
9089
*
9190
* Parses pseudo-variables contained in the specified template view,
9291
* replacing them with any data that has already been set.
93-
*
94-
* @param array $options
95-
* @param bool $saveData
9692
*/
9793
public function render(string $view, ?array $options = null, ?bool $saveData = null): string
9894
{
@@ -155,7 +151,6 @@ public function render(string $view, ?array $options = null, ?bool $saveData = n
155151
* replacing them with any data that has already been set.
156152
*
157153
* @param array $options
158-
* @param bool $saveData
159154
*/
160155
public function renderString(string $template, ?array $options = null, ?bool $saveData = null): string
161156
{
@@ -187,8 +182,8 @@ public function renderString(string $template, ?array $options = null, ?bool $sa
187182
* so that the variable is correctly handled within the
188183
* parsing itself, and contexts (including raw) are respected.
189184
*
190-
* @param string $context The context to escape it for: html, css, js, url, raw
191-
* If 'raw', no escaping will happen
185+
* @param string|null $context The context to escape it for: html, css, js, url, raw
186+
* If 'raw', no escaping will happen
192187
*/
193188
public function setData(array $data = [], ?string $context = null): RendererInterface
194189
{
@@ -503,9 +498,9 @@ public function setConditionalDelimiters($leftDelimiter = '{', $rightDelimiter =
503498
* Handles replacing a pseudo-variable with the actual content. Will double-check
504499
* for escaping brackets.
505500
*
506-
* @param mixed $pattern
507-
* @param string $content
508-
* @param string $template
501+
* @param array|string $pattern
502+
* @param string $content
503+
* @param string $template
509504
*/
510505
protected function replaceSingle($pattern, $content, $template, bool $escape = false): string
511506
{
@@ -698,9 +693,9 @@ public function removePlugin(string $alias)
698693
* Converts an object to an array, respecting any
699694
* toArray() methods on an object.
700695
*
701-
* @param mixed $value
696+
* @param object $value
702697
*
703-
* @return mixed
698+
* @return array
704699
*/
705700
protected function objectToArray($value)
706701
{

0 commit comments

Comments
 (0)