Skip to content

Commit 11eeb33

Browse files
committed
Some minor CS improvements to FormHelper
Replaced use of deprecated method getVar by get. Improved DocBocks, mostly data types Removed deprecated DocBock tag because it's an invalid use of such. This makes the method look like it was deprecated but in reality it's only one of the possible values of one of its parameters.
1 parent 4f745a4 commit 11eeb33

File tree

1 file changed

+17
-18
lines changed

1 file changed

+17
-18
lines changed

lib/Cake/View/Helper/FormHelper.php

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -599,9 +599,9 @@ public function unlockField($name = null) {
599599
*
600600
* @param boolean $lock Whether this field should be part of the validation
601601
* or excluded as part of the unlockedFields.
602-
* @param string|array $field Reference to field to be secured. Should be dot separated to indicate nesting.
602+
* @param string $field Reference to field to be secured. Should be dot separated to indicate nesting.
603603
* @param mixed $value Field value, if value should not be tampered with.
604-
* @return void
604+
* @return mixed|null Not used yet
605605
*/
606606
protected function _secure($lock, $field = null, $value = null) {
607607
if (!$field) {
@@ -1029,8 +1029,8 @@ public function input($fieldName, $options = array()) {
10291029
/**
10301030
* Generates an input element
10311031
*
1032-
* @param type $args
1033-
* @return type
1032+
* @param array $args The options for the input element
1033+
* @return string The generated input element
10341034
*/
10351035
protected function _getInput($args) {
10361036
extract($args);
@@ -1069,7 +1069,7 @@ protected function _getInput($args) {
10691069
/**
10701070
* Generates input options array
10711071
*
1072-
* @param type $options
1072+
* @param array $options
10731073
* @return array Options
10741074
*/
10751075
protected function _parseOptions($options) {
@@ -1100,7 +1100,7 @@ protected function _parseOptions($options) {
11001100
/**
11011101
* Generates list of options for multiple select
11021102
*
1103-
* @param type $options
1103+
* @param array $options
11041104
* @return array
11051105
*/
11061106
protected function _optionsOptions($options) {
@@ -1110,7 +1110,7 @@ protected function _optionsOptions($options) {
11101110
$varName = Inflector::variable(
11111111
Inflector::pluralize(preg_replace('/_id$/', '', $this->field()))
11121112
);
1113-
$varOptions = $this->_View->getVar($varName);
1113+
$varOptions = $this->_View->get($varName);
11141114
if (!is_array($varOptions)) {
11151115
return $options;
11161116
}
@@ -1124,7 +1124,7 @@ protected function _optionsOptions($options) {
11241124
/**
11251125
* Magically set option type and corresponding options
11261126
*
1127-
* @param type $options
1127+
* @param array $options
11281128
* @return array
11291129
*/
11301130
protected function _magicOptions($options) {
@@ -1192,7 +1192,7 @@ protected function _magicOptions($options) {
11921192
/**
11931193
* Generate format options
11941194
*
1195-
* @param type $options
1195+
* @param array $options
11961196
* @return array
11971197
*/
11981198
protected function _getFormat($options) {
@@ -1211,8 +1211,8 @@ protected function _getFormat($options) {
12111211
/**
12121212
* Generate label for input
12131213
*
1214-
* @param type $fieldName
1215-
* @param type $options
1214+
* @param string $fieldName
1215+
* @param array $options
12161216
* @return boolean|string false or Generated label element
12171217
*/
12181218
protected function _getLabel($fieldName, $options) {
@@ -1234,7 +1234,7 @@ protected function _getLabel($fieldName, $options) {
12341234
/**
12351235
* Calculates maxlength option
12361236
*
1237-
* @param type $options
1237+
* @param array $options
12381238
* @return array
12391239
*/
12401240
protected function _maxLength($options) {
@@ -1310,9 +1310,8 @@ protected function _extractOption($name, $options, $default = null) {
13101310
*
13111311
* @param string $fieldName
13121312
* @param string $label
1313-
* @param array $options Options for the label element.
1313+
* @param array $options Options for the label element. 'NONE' option is deprecated and will be removed in 3.0
13141314
* @return string Generated label element
1315-
* @deprecated 'NONE' option is deprecated and will be removed in 3.0
13161315
*/
13171316
protected function _inputLabel($fieldName, $label, $options) {
13181317
$labelAttributes = $this->domId(array(), 'for');
@@ -1739,7 +1738,7 @@ public function postButton($title, $url, $options = array()) {
17391738
* @param string $title The content to be wrapped by <a> tags.
17401739
* @param string|array $url Cake-relative URL or array of URL parameters, or external URL (starts with http://)
17411740
* @param array $options Array of HTML attributes.
1742-
* @param string $confirmMessage JavaScript confirmation message.
1741+
* @param bool|string $confirmMessage JavaScript confirmation message.
17431742
* @return string An `<a />` element.
17441743
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html#FormHelper::postLink
17451744
*/
@@ -2234,7 +2233,7 @@ public function hour($fieldName, $format24Hours = false, $attributes = array())
22342233
* - `value` The selected value of the input.
22352234
*
22362235
* @param string $fieldName Prefix name for the SELECT element
2237-
* @param string $attributes Array of Attributes
2236+
* @param array $attributes Array of Attributes
22382237
* @return string Completed minute select input.
22392238
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html#FormHelper::minute
22402239
*/
@@ -2294,7 +2293,7 @@ protected function _dateTimeSelected($select, $fieldName, $attributes) {
22942293
* - `value` The selected value of the input.
22952294
*
22962295
* @param string $fieldName Prefix name for the SELECT element
2297-
* @param string $attributes Array of Attributes
2296+
* @param array|string $attributes Array of Attributes
22982297
* @return string Completed meridian select input
22992298
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html#FormHelper::meridian
23002299
*/
@@ -2344,7 +2343,7 @@ public function meridian($fieldName, $attributes = array()) {
23442343
* @param string $fieldName Prefix name for the SELECT element
23452344
* @param string $dateFormat DMY, MDY, YMD, or null to not generate date inputs.
23462345
* @param string $timeFormat 12, 24, or null to not generate time inputs.
2347-
* @param string $attributes array of Attributes
2346+
* @param array|string $attributes array of Attributes
23482347
* @return string Generated set of select boxes for the date and time formats chosen.
23492348
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html#FormHelper::dateTime
23502349
*/

0 commit comments

Comments
 (0)