diff --git a/admin/userguide/.github/scripts/deploy b/admin/userguide/.github/scripts/deploy.sh similarity index 66% rename from admin/userguide/.github/scripts/deploy rename to admin/userguide/.github/scripts/deploy.sh index ba1ce42d6a84..43e0675db0e6 100755 --- a/admin/userguide/.github/scripts/deploy +++ b/admin/userguide/.github/scripts/deploy.sh @@ -5,8 +5,13 @@ # codeigniter4/userguide repo's master branch. # See https://github.com/codeigniter4/userguide/blob/master/.github/workflows/deploy.yml -REPO=/opt/userguide -SITE=/home/public_html/userguides/userguide4 +REPO="/opt/userguide" +SITE="/home/public_html/userguides/userguide4" + +if [ "$(id -u)" = "0" ]; then + echo "Cannot be run as root. Please run as the user for deployment." + exit 1 +fi cd "$REPO" git switch master diff --git a/admin/userguide/.github/workflows/deploy.yml b/admin/userguide/.github/workflows/deploy.yml index ac8027fc7410..d244eb415978 100644 --- a/admin/userguide/.github/workflows/deploy.yml +++ b/admin/userguide/.github/workflows/deploy.yml @@ -4,7 +4,7 @@ name: Deploy Production on: push: - branches: + branches: - master jobs: @@ -19,4 +19,4 @@ jobs: username: ${{ secrets.USERNAME }} key: ${{ secrets.KEY }} port: ${{ secrets.PORT }} - script: /opt/userguide/.github/scripts/deploy + script: /opt/userguide/.github/scripts/deploy.sh diff --git a/composer.json b/composer.json index 8cb3583805ce..afaf2e9cb60e 100644 --- a/composer.json +++ b/composer.json @@ -32,7 +32,7 @@ "phpunit/phpcov": "^9.0.2", "phpunit/phpunit": "^10.5.16", "predis/predis": "^1.1 || ^2.0", - "rector/rector": "1.0.5", + "rector/rector": "1.1.0", "vimeo/psalm": "^5.0" }, "replace": { diff --git a/phpstan-baseline.php b/phpstan-baseline.php index e7e16da515ee..418430fa6145 100644 --- a/phpstan-baseline.php +++ b/phpstan-baseline.php @@ -8936,21 +8936,6 @@ 'count' => 1, 'path' => __DIR__ . '/system/View/Cell.php', ]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\View\\\\Cell\\:\\:prepareParams\\(\\) has parameter \\$params with no value type specified in iterable type array\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/View/Cell.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\View\\\\Cell\\:\\:prepareParams\\(\\) return type has no value type specified in iterable type array\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/View/Cell.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\View\\\\Cell\\:\\:render\\(\\) has parameter \\$params with no value type specified in iterable type array\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/View/Cell.php', -]; $ignoreErrors[] = [ 'message' => '#^Method CodeIgniter\\\\View\\\\Cell\\:\\:renderCell\\(\\) has parameter \\$params with no value type specified in iterable type array\\.$#', 'count' => 1, @@ -8996,236 +8981,26 @@ 'count' => 1, 'path' => __DIR__ . '/system/View/Cells/Cell.php', ]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\View\\\\Filters\\:\\:default\\(\\) has parameter \\$value with no value type specified in iterable type array\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/View/Filters.php', -]; $ignoreErrors[] = [ 'message' => '#^Method CodeIgniter\\\\View\\\\Parser\\:\\:addPlugin\\(\\) has parameter \\$callback with no signature specified for callable\\.$#', 'count' => 1, 'path' => __DIR__ . '/system/View/Parser.php', ]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\View\\\\Parser\\:\\:applyFilters\\(\\) has parameter \\$filters with no value type specified in iterable type array\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/View/Parser.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\View\\\\Parser\\:\\:objectToArray\\(\\) has parameter \\$value with no value type specified in iterable type array\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/View/Parser.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\View\\\\Parser\\:\\:objectToArray\\(\\) return type has no value type specified in iterable type array\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/View/Parser.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\View\\\\Parser\\:\\:parse\\(\\) has parameter \\$data with no value type specified in iterable type array\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/View/Parser.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\View\\\\Parser\\:\\:parse\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/View/Parser.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\View\\\\Parser\\:\\:parsePair\\(\\) has parameter \\$data with no value type specified in iterable type array\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/View/Parser.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\View\\\\Parser\\:\\:parsePair\\(\\) return type has no value type specified in iterable type array\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/View/Parser.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\View\\\\Parser\\:\\:parseSingle\\(\\) return type has no value type specified in iterable type array\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/View/Parser.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\View\\\\Parser\\:\\:prepareReplacement\\(\\) has parameter \\$matches with no value type specified in iterable type array\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/View/Parser.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\View\\\\Parser\\:\\:render\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/View/Parser.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\View\\\\Parser\\:\\:renderString\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/View/Parser.php', -]; $ignoreErrors[] = [ 'message' => '#^Method CodeIgniter\\\\View\\\\Parser\\:\\:replaceSingle\\(\\) has parameter \\$pattern with no value type specified in iterable type array\\.$#', 'count' => 1, 'path' => __DIR__ . '/system/View/Parser.php', ]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\View\\\\Parser\\:\\:setData\\(\\) has parameter \\$data with no value type specified in iterable type array\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/View/Parser.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Property CodeIgniter\\\\View\\\\Parser\\:\\:\\$dataContexts type has no value type specified in iterable type array\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/View/Parser.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Property CodeIgniter\\\\View\\\\Parser\\:\\:\\$noparseBlocks type has no value type specified in iterable type array\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/View/Parser.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\View\\\\RendererInterface\\:\\:render\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/View/RendererInterface.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\View\\\\RendererInterface\\:\\:renderString\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/View/RendererInterface.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\View\\\\RendererInterface\\:\\:setData\\(\\) has parameter \\$data with no value type specified in iterable type array\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/View/RendererInterface.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\View\\\\Table\\:\\:__construct\\(\\) has parameter \\$config with no value type specified in iterable type array\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/View/Table.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\View\\\\Table\\:\\:_defaultTemplate\\(\\) return type has no value type specified in iterable type array\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/View/Table.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\View\\\\Table\\:\\:_prepArgs\\(\\) has parameter \\$args with no value type specified in iterable type array\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/View/Table.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\View\\\\Table\\:\\:_prepArgs\\(\\) return type has no value type specified in iterable type array\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/View/Table.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\View\\\\Table\\:\\:_setFromArray\\(\\) has parameter \\$data with no value type specified in iterable type array\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/View/Table.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\View\\\\Table\\:\\:generate\\(\\) has parameter \\$tableData with no value type specified in iterable type array\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/View/Table.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\View\\\\Table\\:\\:makeColumns\\(\\) has parameter \\$array with no value type specified in iterable type array\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/View/Table.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\View\\\\Table\\:\\:makeColumns\\(\\) return type has no value type specified in iterable type array\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/View/Table.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\View\\\\Table\\:\\:setTemplate\\(\\) has parameter \\$template with no value type specified in iterable type array\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/View/Table.php', -]; $ignoreErrors[] = [ 'message' => '#^Only booleans are allowed in an if condition, string\\|null given\\.$#', 'count' => 1, 'path' => __DIR__ . '/system/View/Table.php', ]; -$ignoreErrors[] = [ - 'message' => '#^Property CodeIgniter\\\\View\\\\Table\\:\\:\\$footing type has no value type specified in iterable type array\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/View/Table.php', -]; $ignoreErrors[] = [ 'message' => '#^Property CodeIgniter\\\\View\\\\Table\\:\\:\\$function type has no signature specified for callable\\.$#', 'count' => 1, 'path' => __DIR__ . '/system/View/Table.php', ]; -$ignoreErrors[] = [ - 'message' => '#^Property CodeIgniter\\\\View\\\\Table\\:\\:\\$heading type has no value type specified in iterable type array\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/View/Table.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Property CodeIgniter\\\\View\\\\Table\\:\\:\\$rows type has no value type specified in iterable type array\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/View/Table.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Property CodeIgniter\\\\View\\\\Table\\:\\:\\$template type has no value type specified in iterable type array\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/View/Table.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\View\\\\View\\:\\:getData\\(\\) return type has no value type specified in iterable type array\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/View/View.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\View\\\\View\\:\\:getPerformanceData\\(\\) return type has no value type specified in iterable type array\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/View/View.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\View\\\\View\\:\\:include\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/View/View.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\View\\\\View\\:\\:render\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/View/View.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\View\\\\View\\:\\:renderString\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/View/View.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method CodeIgniter\\\\View\\\\View\\:\\:setData\\(\\) has parameter \\$data with no value type specified in iterable type array\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/View/View.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Property CodeIgniter\\\\View\\\\View\\:\\:\\$data type has no value type specified in iterable type array\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/View/View.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Property CodeIgniter\\\\View\\\\View\\:\\:\\$performanceData type has no value type specified in iterable type array\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/View/View.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Property CodeIgniter\\\\View\\\\View\\:\\:\\$renderVars type has no value type specified in iterable type array\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/View/View.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Property CodeIgniter\\\\View\\\\View\\:\\:\\$sections type has no value type specified in iterable type array\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/View/View.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Property CodeIgniter\\\\View\\\\View\\:\\:\\$tempData type has no value type specified in iterable type array\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/system/View/View.php', -]; $ignoreErrors[] = [ 'message' => '#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#', 'count' => 2, @@ -15866,11 +15641,6 @@ 'count' => 1, 'path' => __DIR__ . '/tests/system/Validation/ValidationTest.php', ]; -$ignoreErrors[] = [ - 'message' => '#^Parameter \\#1 \\$params of method CodeIgniter\\\\View\\\\Cell\\:\\:prepareParams\\(\\) expects array\\|string\\|null, float given\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/tests/system/View/CellTest.php', -]; $ignoreErrors[] = [ 'message' => '#^Property CodeIgniter\\\\View\\\\DecoratorsTest\\:\\:\\$loader \\(CodeIgniter\\\\Autoloader\\\\FileLocator\\) does not accept CodeIgniter\\\\Autoloader\\\\FileLocatorInterface\\.$#', 'count' => 1, @@ -15992,15 +15762,10 @@ 'path' => __DIR__ . '/tests/system/View/TableTest.php', ]; $ignoreErrors[] = [ - 'message' => '#^Parameter \\#1 \\$array of method CodeIgniter\\\\View\\\\Table\\:\\:makeColumns\\(\\) expects array, string given\\.$#', + 'message' => '#^Parameter \\#1 \\$array of method CodeIgniter\\\\View\\\\Table\\:\\:makeColumns\\(\\) expects array\\, string given\\.$#', 'count' => 1, 'path' => __DIR__ . '/tests/system/View/TableTest.php', ]; -$ignoreErrors[] = [ - 'message' => '#^Parameter \\#1 \\$template of method CodeIgniter\\\\View\\\\Table\\:\\:setTemplate\\(\\) expects array, string given\\.$#', - 'count' => 2, - 'path' => __DIR__ . '/tests/system/View/TableTest.php', -]; $ignoreErrors[] = [ 'message' => '#^Parameter \\#2 \\$columnLimit of method CodeIgniter\\\\View\\\\Table\\:\\:makeColumns\\(\\) expects int, string given\\.$#', 'count' => 1, diff --git a/system/View/Cell.php b/system/View/Cell.php index cafe13d161e0..28b249a60e1c 100644 --- a/system/View/Cell.php +++ b/system/View/Cell.php @@ -68,10 +68,10 @@ public function __construct(CacheInterface $cache) /** * Render a cell, returning its body as a string. * - * @param string $library Cell class and method name. - * @param array|string|null $params Parameters to pass to the method. - * @param int $ttl Number of seconds to cache the cell. - * @param string|null $cacheName Cache item name. + * @param string $library Cell class and method name. + * @param array|string|null $params Parameters to pass to the method. + * @param int $ttl Number of seconds to cache the cell. + * @param string|null $cacheName Cache item name. * * @throws ReflectionException */ @@ -117,9 +117,10 @@ public function render(string $library, $params = null, int $ttl = 0, ?string $c * If a string, it should be in the format "key1=value key2=value". * It will be split and returned as an array. * - * @param array|string|null $params + * @param array|string|null $params + * @phpstan-param array|string|float|null $params * - * @return array + * @return array */ public function prepareParams($params) { diff --git a/system/View/Filters.php b/system/View/Filters.php index 56204c86c3d2..dde9ec6d663d 100644 --- a/system/View/Filters.php +++ b/system/View/Filters.php @@ -67,7 +67,7 @@ public static function date_modify($value, string $adjustment) /** * Returns the given default value if $value is empty or undefined. * - * @param array|bool|float|int|object|resource|string|null $value + * @param bool|float|int|list|object|resource|string|null $value */ public static function default($value, string $default): string { diff --git a/system/View/Parser.php b/system/View/Parser.php index 085252102e6e..bbeb00f757c0 100644 --- a/system/View/Parser.php +++ b/system/View/Parser.php @@ -56,7 +56,7 @@ class Parser extends View /** * Stores extracted noparse blocks. * - * @var array + * @var list */ protected $noparseBlocks = []; @@ -72,7 +72,7 @@ class Parser extends View * Stores the context for each data element * when set by `setData` so the context is respected. * - * @var array + * @var array */ protected $dataContexts = []; @@ -99,6 +99,10 @@ public function __construct( * * Parses pseudo-variables contained in the specified template view, * replacing them with any data that has already been set. + * + * @param array|null $options Reserved for 3rd-party uses since + * it might be needed to pass additional info + * to other template engines. */ public function render(string $view, ?array $options = null, ?bool $saveData = null): string { @@ -159,6 +163,10 @@ public function render(string $view, ?array $options = null, ?bool $saveData = n * * Parses pseudo-variables contained in the specified string, * replacing them with any data that has already been set. + * + * @param array|null $options Reserved for 3rd-party uses since + * it might be needed to pass additional info + * to other template engines. */ public function renderString(string $template, ?array $options = null, ?bool $saveData = null): string { @@ -190,6 +198,7 @@ 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 array $data * @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 @@ -222,7 +231,8 @@ public function setData(array $data = [], ?string $context = null): RendererInte * Parses pseudo-variables contained in the specified template, * replacing them with the data in the second param * - * @param array $options Future options + * @param array $data + * @param array $options Future options */ protected function parse(string $template, array $data = [], ?array $options = null): string { @@ -266,6 +276,8 @@ protected function parse(string $template, array $data = [], ?array $options = n /** * Parse a single key/value, extracting it + * + * @return array */ protected function parseSingle(string $key, string $val): array { @@ -280,6 +292,10 @@ protected function parseSingle(string $key, string $val): array * Parse a tag pair * * Parses tag pairs: {some_tag} string... {/some_tag} + * + * @param array $data + * + * @return array */ protected function parsePair(string $variable, array $data, string $template): array { @@ -533,6 +549,8 @@ protected function replaceSingle($pattern, $content, $template, bool $escape = f /** * Callback used during parse() to apply any filters to the value. + * + * @param list $matches */ protected function prepareReplacement(array $matches, string $replace, bool $escape = true): string { @@ -586,6 +604,8 @@ public function shouldAddEscaping(string $key) /** * Given a set of filters, will apply each of the filters in turn * to $replace, and return the modified string. + * + * @param list $filters */ protected function applyFilters(string $replace, array $filters): string { @@ -708,9 +728,9 @@ public function removePlugin(string $alias) * Converts an object to an array, respecting any * toArray() methods on an object. * - * @param array|bool|float|int|object|string|null $value + * @param array|bool|float|int|object|string|null $value * - * @return array|bool|float|int|string|null + * @return array|bool|float|int|string|null */ protected function objectToArray($value) { diff --git a/system/View/RendererInterface.php b/system/View/RendererInterface.php index 62d3d7825060..5fdf8794f12d 100644 --- a/system/View/RendererInterface.php +++ b/system/View/RendererInterface.php @@ -24,10 +24,10 @@ interface RendererInterface * Builds the output based upon a file name and any * data that has already been set. * - * @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 + * @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; @@ -35,17 +35,18 @@ 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|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 + * @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 array $data * @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 diff --git a/system/View/Table.php b/system/View/Table.php index 85770e31915d..60ccc509f9ae 100644 --- a/system/View/Table.php +++ b/system/View/Table.php @@ -27,21 +27,21 @@ class Table /** * Data for table rows * - * @var list|list> + * @var list>|list>> */ public $rows = []; /** * Data for table heading * - * @var array + * @var array */ public $heading = []; /** * Data for table footing * - * @var array + * @var array */ public $footing = []; @@ -62,7 +62,7 @@ class Table /** * Table layout template * - * @var array + * @var array */ public $template; @@ -95,7 +95,7 @@ class Table /** * Set the template from the table config file if it exists * - * @param array $config (default: array()) + * @param array $config (default: array()) */ public function __construct($config = []) { @@ -108,7 +108,8 @@ public function __construct($config = []) /** * Set the template * - * @param array $template + * @param array $template + * @phpstan-param array|string $template * * @return bool */ @@ -157,10 +158,10 @@ public function setFooting() * columns. This allows a single array with many elements to be * displayed in a table that has a fixed column count. * - * @param array $array - * @param int $columnLimit + * @param list $array + * @param int $columnLimit * - * @return array|false + * @return array|false */ public function makeColumns($array = [], $columnLimit = 0) { @@ -260,7 +261,9 @@ public function setSyncRowsWithHeading(bool $orderByKey) * * Ensures a standard associative array format for all cell data * - * @return array|list + * @param array $args + * + * @return array>|list> */ protected function _prepArgs(array $args) { @@ -297,7 +300,7 @@ public function setCaption($caption) /** * Generate the table * - * @param array|BaseResult|null $tableData + * @param array|BaseResult|null $tableData * * @return string */ @@ -472,7 +475,7 @@ protected function _setFromDBResult($object) /** * Set table data from an array * - * @param array $data + * @param array $data * * @return void */ @@ -510,7 +513,7 @@ protected function _compileTemplate() /** * Default Template * - * @return array + * @return array */ protected function _defaultTemplate() { diff --git a/system/View/View.php b/system/View/View.php index 160f1c179278..57b2333d901d 100644 --- a/system/View/View.php +++ b/system/View/View.php @@ -34,14 +34,14 @@ class View implements RendererInterface /** * Saved Data. * - * @var array + * @var array */ protected $data = []; /** * Data for the variables that are available in the Views. * - * @var array|null + * @var array|null */ protected $tempData; @@ -55,7 +55,7 @@ class View implements RendererInterface /** * Data for rendering including Caching and Debug Toolbar data. * - * @var array + * @var array */ protected $renderVars = []; @@ -86,7 +86,7 @@ class View implements RendererInterface * Cache stats about our performance here, * when CI_DEBUG = true * - * @var array + * @var list */ protected $performanceData = []; @@ -120,7 +120,7 @@ class View implements RendererInterface /** * Holds the sections and their data. * - * @var array + * @var array> */ protected $sections = []; @@ -165,13 +165,13 @@ public function __construct( * - cache Number of seconds to cache for * - cache_name Name to use for cache * - * @param string $view File name of the view source - * @param array|null $options Reserved for 3rd-party uses since - * it might be needed to pass additional info - * to other template engines. - * @param bool|null $saveData If true, saves data for subsequent calls, - * if false, cleans the data after displaying, - * if null, uses the config setting. + * @param string $view File name of the view source + * @param array|null $options Reserved for 3rd-party uses since + * it might be needed to pass additional info + * to other template engines. + * @param bool|null $saveData If true, saves data for subsequent calls, + * if false, cleans the data after displaying, + * if null, uses the config setting. */ public function render(string $view, ?array $options = null, ?bool $saveData = null): string { @@ -306,13 +306,13 @@ public function render(string $view, ?array $options = null, ?bool $saveData = n * data that has already been set. * Cache does not apply, because there is no "key". * - * @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|null $saveData If true, saves data for subsequent calls, - * if false, cleans the data after displaying, - * if null, uses the config setting. + * @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|null $saveData If true, saves data for subsequent calls, + * if false, cleans the data after displaying, + * if null, uses the config setting. */ public function renderString(string $view, ?array $options = null, ?bool $saveData = null): string { @@ -393,6 +393,8 @@ public function resetData(): RendererInterface /** * Returns the current data that will be displayed in the view. + * + * @return array */ public function getData(): array { @@ -477,7 +479,8 @@ public function renderSection(string $sectionName, bool $saveData = false) /** * Used within layout views to include additional views. * - * @param bool $saveData + * @param array|null $options + * @param bool $saveData */ public function include(string $view, ?array $options = null, $saveData = true): string { @@ -487,6 +490,8 @@ public function include(string $view, ?array $options = null, $saveData = true): /** * Returns the performance data that might have been collected * during the execution. Used primarily in the Debug Toolbar. + * + * @return list */ public function getPerformanceData(): array { diff --git a/user_guide_src/source/_static/css/citheme.css b/user_guide_src/source/_static/css/citheme.css index 3410fbc5cbb2..b3264e096336 100644 --- a/user_guide_src/source/_static/css/citheme.css +++ b/user_guide_src/source/_static/css/citheme.css @@ -245,6 +245,10 @@ html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not( background-color: #fffff0; } +span.std { + text-wrap: nowrap; +} + /* Messages ----------------------------------------------------------------- */ .rst-content .success {