original_string: protected function cached(string $key, Closure $dataGetter)
      {
          if ($this->cacheRepository->has($key)) {
              return $this->cacheRepository->get($key);
          }
          $result = $dataGetter();
          $this->cacheRepository->put($key, $result, $this->cacheTimeout);
          return $result;
      }
code: protected function cached(string $key, Closure $dataGetter)
      {
          if ($this->cacheRepository->has($key)) {
              return $this->cacheRepository->get($key);
          }
          $result = $dataGetter();
          $this->cacheRepository->put($key, $result, $this->cacheTimeout);
          return $result;
      }
code_tokens: protected function cached ( string $ key , Closure $ dataGetter ) { if ( $ this -> cacheRepository -> has ( $ key ) ) { return $ this -> cacheRepository -> get ( $ key ) ; } $ result = $ dataGetter ( ) ; $ this -> cacheRepository -> put ( $ key , $ result , $ this -> cacheTimeout ) ; return $ result ; }
docstring: Get data from cache.
  If it not exists in cache got it in repository and store in cache.
  
  @param string $key Key to find data in cache
  @param Closure $dataGetter Function to get data in original repository
  
  @return mixed
docstring_tokens: Get data from cache . If it not exists in cache got it in repository and store in cache .