Skip to content
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

docs: fix @param types in html/url helper #6767

Merged
merged 2 commits into from
Oct 27, 2022
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
24 changes: 12 additions & 12 deletions system/Helpers/html_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* Generates an HTML unordered list from an single or
* multi-dimensional array.
*
* @param mixed $attributes HTML attributes string, array, object
* @param array|object|string $attributes HTML attributes string, array, object
*/
function ul(array $list, $attributes = ''): string
{
Expand All @@ -36,7 +36,7 @@ function ul(array $list, $attributes = ''): string
*
* Generates an HTML ordered list from an single or multi-dimensional array.
*
* @param mixed $attributes HTML attributes string, array, object
* @param array|object|string $attributes HTML attributes string, array, object
*/
function ol(array $list, $attributes = ''): string
{
Expand All @@ -50,8 +50,8 @@ function ol(array $list, $attributes = ''): string
*
* Generates an HTML ordered list from an single or multi-dimensional array.
*
* @param mixed $list
* @param mixed $attributes string, array, object
* @param array $list
* @param array|object|string $attributes string, array, object
*/
function _list(string $type = 'ul', $list = [], $attributes = '', int $depth = 0): string
{
Expand Down Expand Up @@ -224,8 +224,8 @@ function script_tag($src = '', bool $indexPage = false): string
*
* Generates link to a CSS file
*
* @param mixed $href Stylesheet href or an array
* @param bool $indexPage should indexPage be added to the CSS path.
* @param array|string $href Stylesheet href or an array
* @param bool $indexPage should indexPage be added to the CSS path.
*/
function link_tag($href = '', string $rel = 'stylesheet', string $type = 'text/css', string $title = '', string $media = '', bool $indexPage = false, string $hreflang = ''): string
{
Expand Down Expand Up @@ -281,9 +281,9 @@ function link_tag($href = '', string $rel = 'stylesheet', string $type = 'text/c
* Generates a video element to embed videos. The video element can
* contain one or more video sources
*
* @param mixed $src Either a source string or an array of sources
* @param string $unsupportedMessage The message to display if the media tag is not supported by the browser
* @param string $attributes HTML attributes
* @param array|string $src Either a source string or an array of sources
* @param string $unsupportedMessage The message to display if the media tag is not supported by the browser
* @param string $attributes HTML attributes
*/
function video($src, string $unsupportedMessage = '', string $attributes = '', array $tracks = [], bool $indexPage = false): string
{
Expand Down Expand Up @@ -327,9 +327,9 @@ function video($src, string $unsupportedMessage = '', string $attributes = '', a
*
* Generates an audio element to embed sounds
*
* @param mixed $src Either a source string or an array of sources
* @param string $unsupportedMessage The message to display if the media tag is not supported by the browser.
* @param string $attributes HTML attributes
* @param array|string $src Either a source string or an array of sources
* @param string $unsupportedMessage The message to display if the media tag is not supported by the browser.
* @param string $attributes HTML attributes
*/
function audio($src, string $unsupportedMessage = '', string $attributes = '', array $tracks = [], bool $indexPage = false): string
{
Expand Down
33 changes: 16 additions & 17 deletions system/Helpers/url_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,7 @@ function site_url($relativePath = '', ?string $scheme = null, ?App $config = nul
* Returns the base URL as defined by the App config.
* Base URLs are trimmed site URLs without the index page.
*
* @param mixed $relativePath URI string or array of URI segments
* @param string $scheme
* @param array|string $relativePath URI string or array of URI segments
*/
function base_url($relativePath = '', ?string $scheme = null): string
{
Expand Down Expand Up @@ -143,7 +142,7 @@ function current_url(bool $returnObject = false, ?IncomingRequest $request = nul
* If that's not available, however, we'll use a sanitized url from $_SERVER['HTTP_REFERER']
* which can be set by the user so is untrusted and not set by certain browsers/servers.
*
* @return mixed|string|URI
* @return string|URI
*/
function previous_url(bool $returnObject = false)
{
Expand Down Expand Up @@ -197,10 +196,10 @@ function index_page(?App $altConfig = null): string
*
* Creates an anchor based on the local URL.
*
* @param mixed $uri URI string or array of URI segments
* @param string $title The link title
* @param mixed $attributes Any attributes
* @param App|null $altConfig Alternate configuration to use
* @param array|string $uri URI string or array of URI segments
* @param string $title The link title
* @param array|object|string $attributes Any attributes
* @param App|null $altConfig Alternate configuration to use
*/
function anchor($uri = '', string $title = '', $attributes = '', ?App $altConfig = null): string
{
Expand Down Expand Up @@ -230,10 +229,10 @@ function anchor($uri = '', string $title = '', $attributes = '', ?App $altConfig
* Creates an anchor based on the local URL. The link
* opens a new window based on the attributes specified.
*
* @param string $uri the URL
* @param string $title the link title
* @param mixed $attributes any attributes
* @param App|null $altConfig Alternate configuration to use
* @param string $uri the URL
* @param string $title the link title
* @param array|false|object|string $attributes any attributes
* @param App|null $altConfig Alternate configuration to use
*/
function anchor_popup($uri = '', string $title = '', $attributes = false, ?App $altConfig = null): string
{
Expand Down Expand Up @@ -280,9 +279,9 @@ function anchor_popup($uri = '', string $title = '', $attributes = false, ?App $
/**
* Mailto Link
*
* @param string $email the email address
* @param string $title the link title
* @param mixed $attributes any attributes
* @param string $email the email address
* @param string $title the link title
* @param array|object|string $attributes any attributes
*/
function mailto(string $email, string $title = '', $attributes = ''): string
{
Expand All @@ -300,9 +299,9 @@ function mailto(string $email, string $title = '', $attributes = ''): string
*
* Create a spam-protected mailto link written in Javascript
*
* @param string $email the email address
* @param string $title the link title
* @param mixed $attributes any attributes
* @param string $email the email address
* @param string $title the link title
* @param array|object|string $attributes any attributes
*/
function safe_mailto(string $email, string $title = '', $attributes = ''): string
{
Expand Down