return data formatted by given function

@param string $key
@param mixed $data
@param array $rulesList
@return mixed
491903
protected function _dataPreparation($key, $data, array $rulesList)
    {
        foreach ($rulesList as $ruleKey => $function) {

            switch (true) {
                case is_null($key):
                    $data = $this->_prepareWholeData($ruleKey, $data, $function);
                    break;

                case preg_match($ruleKey, $key) && !is_null($key):
                    $data = $this->_callUserFunction($function, $key, $data, null);
                    break;

                default:
                    break;
            }
        }

        return $data;
    }
36278
function getMetaData($key = null)
    {
        $data = $this->data;
        if ($key !== null)
            $data = ( isset($data[$key]) ) ? $data[$key] : null;


        return $data;
    }
781604
protected function cacheData(string $key, string $data) : string
    {
        $this->cache[$key] = $data;

        return $data;
    }
375979
public function format($data)
    {
        foreach ($this->rules as $oldKey => $newKey) {
            if ($this->isRegex($oldKey)) {
                $this->remapRecursively($data, $oldKey, $newKey);
            } else {
                $this->remap($data, $oldKey, $newKey);
            }
        }

        $data->unsetNull();

        return $data;
    }
411109
public function zoneId(array $condition, array $data, $key)
    {
        if (isset($data['data']['order'][$key])) {
            return $this->checkZoneIdByAddressId($condition, $data, $key);
        }

        return $this->checkZoneIdByAddressData($condition, $data);
    }
567076
public function indexBy(array $data, $key)
    {
        $newData = [];
        foreach ($data as $row) {
            $newData[$row[$key]] = $row;
        }

        return $newData;
    }
1041503
private function _getSecondaryKeys($data, $key = null)
    {
        if ($key) {
            $data = ArrayHelper::getValue($data, $key, []);
        }

        return ArrayHelper::getColumn($data, $this->relSecondaryKey);
    }
220969
private function checkDataIsUnreliable($data, $key)
    {
        return isset($data[$key]) && ($data[$key] !== $this->visitorInfo[$key]);
    }
722257
protected function parseSchema($data, $key)
    {
        $this->parseDefined($key);

        if (array_key_exists(self::REQUIRED_KEY, $data)) {
            $this->parseRequired(
                $key,
                $data[self::REQUIRED_KEY]
            );
        }

        if (array_key_exists(self::DEFAULT_VALUE, $data)) {
            $this->parseDefault(
                $key,
                $data[self::DEFAULT_VALUE]
            );
        }
    }
292064
protected function runDate($key, $datas, $rule)
    {
        if (false === strtotime($datas[$key])) {
            $this->fails[] = $messageKey = "date.$key";

            $this->addMessage($key, $rule, $messageKey);
        }
    }
184554
protected function addMessage($key, $rule, $specialRule, array $datas = [])
    {
        $specialMessages = $this->getMessageReposity();
        $defaultMessages = $this->defaultErrorMessages;

        if (count($datas) === 0) {
            $datas = [$key];
        }

        if (isset($specialMessages[$specialRule])) {
            $selectedMessage = $specialMessages[$specialRule];
        } else {
            $selectedMessage = $defaultMessages[$rule];
        }

        array_unshift($datas, $selectedMessage);
        $this->failedMessages[] = call_user_func_array('sprintf', $datas);
    }
770993
protected function _validate($key, $val)
    {
        // try each rule function
        foreach ($this->rules as $rule => $is_true) {
            if ($is_true) {
                $function = $this->functions[$rule];
                $args = $this->arguments[$rule]; // Arguments of rule

                $valid = true;
                if(is_array($val)) {
                    foreach($val as $v) {
                        $valid = $valid && (empty($args)) ? $function($v) : $function($v, $args);
                    }
                } else {
                    $valid = (empty($args)) ? $function($val) : $function($val, $args);
                }

                if ($valid === FALSE) {
                    $this->registerError($rule, $key);

                    $this->rules = array();  // reset rules
                    $this->filters = array();
                    return FALSE;
                }
            }
        }

        $this->validData[$key] = $val;
        return TRUE;
    }
321961
protected static function _getPluginData(array $data, $key = null)
    {
        if (isset($data[$key])) {
            $data = $data[$key];
        }

        return new Data($data);
    }
724233
protected function getDataValue( $data, $key )
	{
		if( is_numeric( $key ) ){
			$value = $key;
		} elseif( strpos( $key, '.' ) ){
			// 支持二维数组验证
			list( $name1, $name2 ) = explode( '.', $key );
			$value = isset( $data[$name1][$name2] ) ? $data[$name1][$name2] : null;
		} else{
			$value = isset( $data[$key] ) ? $data[$key] : null;
		}
		return $value;
	}
703576
protected function _validateDataKey($key, $data)
    {
        $dataOkFlag = true;

        if (!$this->_validationOn) {
            return $dataOkFlag;
        }

        foreach ($this->_validationRules as $ruleKey => $ruleValue) {
            if (!preg_match($ruleKey, $key)) {
                continue;
            }

            $bool = $this->_validateData($ruleValue, $key, $data);
            if (!$bool) {
                $dataOkFlag = false;
            }
        }

        return $dataOkFlag;
    }
288138
public function parse($data, $key = null)
    {
        if ($key) $this->apiKey = $key;
        return $this->get($data, [], null, 'parse');
    }
653902
public function createActions(array $data): array
    {
        return array_map(function ($data) {
            if ($data instanceof RuleAction) {
                return $data;
            }

            return RuleAction::createFromData((array) $data);
        }, $data);
    }