src/traits/EntityTrait.php
public function rules()
    {
        if (isset(static::$rulesList[static::class]) === false) {
            static::$rulesList[static::class] = isset($this->rules) === true
                ? $this->rules
                : [];
            foreach (static::getTraits() as $name) {
                if (null !== $rules = $this->callTraitMethod($name, 'Rules')) {
                    static::$rulesList[static::class] = ArrayHelper::merge(
                        static::$rulesList[static::class],
                        $rules
                    );
                }
            }
        }
        return static::$rulesList[static::class];
    }
public function rules()
    {
        if (isset(static::$rulesList[static::class]) === false) {
            static::$rulesList[static::class] = isset($this->rules) === true
                ? $this->rules
                : [];
            foreach (static::getTraits() as $name) {
                if (null !== $rules = $this->callTraitMethod($name, 'Rules')) {
                    static::$rulesList[static::class] = ArrayHelper::merge(
                        static::$rulesList[static::class],
                        $rules
                    );
                }
            }
        }
        return static::$rulesList[static::class];
    }
Get all model rules.
This method merges a model rules (it must consists in $model->rules)
with rules of all used traits (it must be defined as `public function TraitnameRules`).

@return array