Created
May 6, 2013 00:08
-
-
Save tassoevan/5522665 to your computer and use it in GitHub Desktop.
Easy access to \Respect\Validation\Validator class
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Author's recommendation | |
use Respect\Validation\Validator as v; | |
$number = 123; | |
v::numeric()->validate($number); //true | |
// The author method can be a little uncomfortable, because | |
// the 'v' alias will be present in all source code and it | |
// is meaningless according OOP. | |
// Here my approach | |
$v = 'Respect\Validation\Validator'; | |
$number = 123; | |
$v::numeric()->validate($number); //true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment