Skip to content
Permalink
Browse files

Avoiding fatal error in hhvm, the issue around constants in traits is…

… still there
  • Loading branch information...
lorenzo committed May 5, 2015
1 parent c3c7a7b commit e235e6aaa9df1512f81c81e84ad76630a8b3c3c5
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/Validation/ValidatorAwareTrait.php
@@ -84,8 +84,11 @@ trait ValidatorAwareTrait
* use null to get a validator.
* @return \Cake\Validation\Validator
*/
public function validator($name = self::DEFAULT_VALIDATOR, Validator $validator = null)
public function validator($name = null, Validator $validator = null)
{
if ($name === null) {
$name = self::DEFAULT_VALIDATOR;
}
if ($validator === null && isset($this->_validators[$name])) {
return $this->_validators[$name];
}

0 comments on commit e235e6a

Please sign in to comment.
You can’t perform that action at this time.