mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-17 16:01:15 +08:00
27 lines
653 B
PHP
27 lines
653 B
PHP
<?php
|
|
/**
|
|
* @link https://www.yiiframework.com/
|
|
* @copyright Copyright (c) 2008 Yii Software LLC
|
|
* @license https://www.yiiframework.com/license/
|
|
*/
|
|
|
|
namespace yiiunit\data\validators\models;
|
|
|
|
use yii\base\Model;
|
|
|
|
class ValidatorTestEachAndInlineMethodModel extends Model
|
|
{
|
|
public $arrayProperty = [true, false];
|
|
|
|
public function rules()
|
|
{
|
|
return [
|
|
['arrayProperty', 'each', 'rule' => [function ($attribute, $params, $validator) {
|
|
if (is_array($this->$attribute)) {
|
|
$this->addError($attribute, 'Each & Inline validators bug');
|
|
}
|
|
}]],
|
|
];
|
|
}
|
|
}
|