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;
    }
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;
    }
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 ; }
return data formatted by given function

@param string $key
@param mixed $data
@param array $rulesList
@return mixed
return data formatted by given function