Merge pull request #185 from AchoArnold/patch-1

Makes the data parameter optional in the constructor
This commit is contained in:
Willem Wollebrants 2017-02-14 16:36:59 +01:00 committed by GitHub
commit 971501551c

View File

@ -86,7 +86,7 @@ class Validator
* @param string $langDir
* @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
// This is useful for limiting raw $_POST or $_GET data to only known fields