Browse Source

Add type hinting

tags/2.0.0-beta
slavcodev 11 years ago
parent
commit
cbca145e97
  1. 12
      framework/yii/validators/Validator.php

12
framework/yii/validators/Validator.php

@ -131,17 +131,9 @@ abstract class Validator extends Component
* @param array $params initial values to be applied to the validator properties * @param array $params initial values to be applied to the validator properties
* @return Validator the validator * @return Validator the validator
*/ */
public static function createValidator($type, $object, $attributes, $params = []) public static function createValidator($type, $object, array $attributes, $params = [])
{ {
$params['attributes'] = (array) $attributes; $params['attributes'] = $attributes;
if (isset($params['on'])) {
$params['on'] = (array) $params['on'];
}
if (isset($params['except'])) {
$params['except'] = (array) $params['except'];
}
if (method_exists($object, $type)) { if (method_exists($object, $type)) {
// method-based validator // method-based validator

Loading…
Cancel
Save