From a4712f562c27cdb2f2fcb15b37731e948f57276a Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 6 Jan 2014 11:25:46 +0200 Subject: Make CI_Form_validation::error()'s first parameter mandatory and add a typehint for CI_Form_validation::error() --- system/libraries/Form_validation.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php index 5ea2f81af..c02abbbcb 100644 --- a/system/libraries/Form_validation.php +++ b/system/libraries/Form_validation.php @@ -248,9 +248,9 @@ class CI_Form_validation { * @param array $data * @return void */ - public function set_data($data = '') + public function set_data(array $data) { - if ( ! empty($data) && is_array($data)) + if ( ! empty($data)) { $this->validation_data = $data; } @@ -304,12 +304,12 @@ class CI_Form_validation { * * Gets the error message associated with a particular field * - * @param string the field name - * @param string the html start tag - * @param strign the html end tag + * @param string $field Field name + * @param string $prefix HTML start tag + * @param strign $suffix HTML end tag * @return string */ - public function error($field = '', $prefix = '', $suffix = '') + public function error($field, $prefix = '', $suffix = '') { if (empty($this->_field_data[$field]['error'])) { -- cgit v1.2.3-24-g4f1b