Open filhodanuvem opened 10 years ago
This validator has been part of the package in v0.1.0. It has been removed because Validator interface has changed. New interface does not allow to pass Input haystack to the validator. However, I am sure that the value can be retrieved at the time of constructing the condition. Alternatively, why not pass the value itself? eg.,
$test = new \Gajus\Vlad\Test();
$test->assert('foo')->is('Equal', ['to' => $input['bar']);
I think that to test a POST request, for exemple, would more simple write something like that:
$test->assert('user[password]')->is('Equal', ['field' => 'user[password_2]'] );
// I use $_POST just once
$test->assess($_POST);
But, I understood what you said and we could use the value itself.
@cloudson you are right. That's how you'd use it. "foo" in my example is not password, it is the selector.
Hi @gajus ! My first thought about input filters would be case of "passwords". So, We could talk about it. I Think that just with a new validator isEqual anyone could write a passwords validation.
Eg.:
Questions:
:cloud: