Skip to content

Unreasonable default parameter #482

Description

@JuveLee

The parameter 'messages' for function CodeIgniter\Controller->validate has a unreasonable default value 'null'.
Beacuse that function call a function CodeIgniter\Validation\Validation->setRules, and the second parameter of that function has a default value 'empty array'.
So when I use validate function like this:
$this->validate($this->request, ['title' => 'required', 'text' => 'required'])
There will be an error "Argument 2 passed to CodeIgniter\Validation\Validation::setRules() must be of the type array, null given".

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions