src/Base/Model.php
public function getActiveValidators($attribute = null)
    {
        $validators = [];
        $scenario = $this->getScenario();
        try {
            $_validators = $this->getValidators();
        } catch (InvalidConfigException $exception) {
            Reaction::error($exception);
            $_validators = [];
        }
        foreach ($_validators as $validator) {
            if ($validator->isActive($scenario) && ($attribute === null || in_array($attribute, $validator->getAttributeNames(), true))) {
                $validators[] = $validator;
            }
        }

        return $validators;
    }
public function getActiveValidators($attribute = null)
    {
        $validators = [];
        $scenario = $this->getScenario();
        try {
            $_validators = $this->getValidators();
        } catch (InvalidConfigException $exception) {
            Reaction::error($exception);
            $_validators = [];
        }
        foreach ($_validators as $validator) {
            if ($validator->isActive($scenario) && ($attribute === null || in_array($attribute, $validator->getAttributeNames(), true))) {
                $validators[] = $validator;
            }
        }

        return $validators;
    }
Returns the validators applicable to the current [[scenario]].
@param string $attribute the name of the attribute whose applicable validators should be returned.
If this is null, the validators for ALL attributes in the model will be returned.
@return \Reaction\Validators\Validator[] the validators applicable to the current [[scenario]].