src/validators/ArrayFilterTrait.php
public static function getAllowedAttributes($entity)
    {
        /** @noinspection PhpUndefinedMethodInspection */
        $validators = (new self())->getActiveValidators($entity);
        foreach ($validators as $validator) {
            if ($validator instanceof ArrayFilterValidator) {
                return ArrayHelper::getValue($validator, 'allowed');
            }
        }

        return [];
    }
public static function getAllowedAttributes($entity)
    {
        /** @noinspection PhpUndefinedMethodInspection */
        $validators = (new self())->getActiveValidators($entity);
        foreach ($validators as $validator) {
            if ($validator instanceof ArrayFilterValidator) {
                return ArrayHelper::getValue($validator, 'allowed');
            }
        }

        return [];
    }
@param $entity

@return array|string