Makes the data parameter optional in the constructor

This Fixes #184
This commit is contained in:
Acho Arnold 2017-02-14 16:30:25 +01:00 committed by GitHub
parent 79de211bdf
commit f698be0c95

View File

@ -86,7 +86,7 @@ class Validator
* @param string $langDir * @param string $langDir
* @throws \InvalidArgumentException * @throws \InvalidArgumentException
*/ */
public function __construct($data, $fields = array(), $lang = null, $langDir = null) public function __construct($data = array(), $fields = array(), $lang = null, $langDir = null)
{ {
// Allows filtering of used input fields against optional second array of field names allowed // Allows filtering of used input fields against optional second array of field names allowed
// This is useful for limiting raw $_POST or $_GET data to only known fields // This is useful for limiting raw $_POST or $_GET data to only known fields