From b21b1ef41d72b5fb74cfa62f88490d93bc3c686b Mon Sep 17 00:00:00 2001 From: mscherer Date: Wed, 28 Jan 2026 16:15:53 +0100 Subject: [PATCH] Add type annotations to helper method signatures Updates signatures to include full type annotations matching CakePHP 5.x source: - FormHelper: text, password, end, unlockField - HtmlHelper: charset, link, setTemplates - UrlHelper: build --- docs/en/views/helpers/form.md | 8 ++++---- docs/en/views/helpers/html.md | 6 +++--- docs/en/views/helpers/url.md | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/en/views/helpers/form.md b/docs/en/views/helpers/form.md index c73ade2d28..f47782b8f7 100644 --- a/docs/en/views/helpers/form.md +++ b/docs/en/views/helpers/form.md @@ -824,7 +824,7 @@ however, this parameter is used primarily to specify HTML tag attributes ### Creating Text Inputs -`method` Cake\\View\\Helper\\FormHelper::**text**(string $name, array $options) +`method` Cake\\View\\Helper\\FormHelper::**text**(string $fieldName, array $options = []): string - `$name` - A field name in the form `'Modelname.fieldname'`. - `$options` - An optional array including any of the @@ -846,7 +846,7 @@ Will output: ### Creating Password Inputs -`method` Cake\\View\\Helper\\FormHelper::**password**(string $fieldName, array $options) +`method` Cake\\View\\Helper\\FormHelper::**password**(string $fieldName, array $options = []): string - `$fieldName` - A field name in the form `'Modelname.fieldname'`. - `$options` - An optional array including any of the @@ -2136,7 +2136,7 @@ echo $this->Form->button('Submit Form', [ ## Closing the Form -`method` Cake\\View\\Helper\\FormHelper::**end**($secureAttributes = []): string +`method` Cake\\View\\Helper\\FormHelper::**end**(array $secureAttributes = []): string - `$secureAttributes` - Optional. Allows you to provide secure attributes which will be passed as HTML attributes into the hidden input elements @@ -2771,7 +2771,7 @@ As mentioned previously when using FormProtectionComponent, you should always cl your forms using `Cake\View\Helper\FormHelper::end()`. This will ensure that the special `_Token` inputs are generated. -`method` Cake\\View\\Helper\\FormHelper::**unlockField**($name) +`method` Cake\\View\\Helper\\FormHelper::**unlockField**(string $name): $this - `$name` - Optional. The dot-separated name for the field. diff --git a/docs/en/views/helpers/html.md b/docs/en/views/helpers/html.md index ebb2c44e88..06be4f6627 100644 --- a/docs/en/views/helpers/html.md +++ b/docs/en/views/helpers/html.md @@ -28,7 +28,7 @@ methods of the HtmlHelper and how to use them. ### Creating Charset Tags -`method` Cake\\View\\Helper\\HtmlHelper::**charset**($charset=null): string +`method` Cake\\View\\Helper\\HtmlHelper::**charset**(?string $charset = null): string Used to create a meta tag specifying the document's character. The default value is UTF-8. An example use: @@ -308,7 +308,7 @@ Will output: ### Creating Links -`method` Cake\\View\\Helper\\HtmlHelper::**link**($title, $url = null, array $options = []): string +`method` Cake\\View\\Helper\\HtmlHelper::**link**(array|string $title, array|string|null $url = null, array $options = []): string General purpose method for creating HTML links. Use `$options` to specify attributes for the element and whether or not the @@ -895,7 +895,7 @@ Output: ## Changing the Tags Output by HtmlHelper -`method` Cake\\View\\Helper\\HtmlHelper::**setTemplates**(array $templates) +`method` Cake\\View\\Helper\\HtmlHelper::**setTemplates**(array $templates): $this Load an array of templates to add/replace templates: diff --git a/docs/en/views/helpers/url.md b/docs/en/views/helpers/url.md index f119739703..e45cee15c4 100644 --- a/docs/en/views/helpers/url.md +++ b/docs/en/views/helpers/url.md @@ -9,7 +9,7 @@ overriding the core helper with an application one. See the ## Generating URLs -`method` Cake\\View\\Helper\\UrlHelper::**build**($url = null, array $options = []): string +`method` Cake\\View\\Helper\\UrlHelper::**build**(array|string|null $url = null, array $options = []): string Returns a URL pointing to a combination of controller and action. If `$url` is empty, it returns the `REQUEST_URI`, otherwise it