original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: return data formatted by given function
  
  @param string $key
  @param mixed $data
  @param array $rulesList
  @return mixed
docstring_tokens: return data formatted by given function