<commit_before><?php

namespace Columnis\Model;

use Zend\Cache\Storage\StorageInterface;
use GuzzleHttp\Subscriber\Cache\CacheStorageInterface;
use GuzzleHttp\Message\RequestInterface;
use GuzzleHttp\Message\ResponseInterface;

class ZfCacheAdapter implements CacheStorageInterface {

    /**
     *
     * @var StorageInterface 
     */
    private $storageCache = null;

    /**
     * @param StorageInterface $cache Zend Framework 2 cache adapter
     */
    public function __construct(StorageInterface $cache) {
        $this->storageCache = $cache;
    }

    public function contains(RequestInterface $request) {
        return $this->storageCache->hasItem($this->buildKey($request->getUrl()));
    }

    public function cache(RequestInterface $request, ResponseInterface $response) {
        return $this->storageCache->setItem($this->buildKey($request->getUrl()), $response);
    }

    public function delete(RequestInterface $request) {
        return $this->storageCache->removeItem($this->buildKey($request->getUrl()));
    }

    public function fetch(RequestInterface $request) {
        return $this->storageCache->getItem($this->buildKey($request->getUrl()));
    }

    public function purge($url) {
        return $this->storageCache->removeItem($this->buildKey($url));
    }

    private function buildKey($url) {
        return md5($url);
    }
}

?><commit_msg>Scrutinizer Auto-Fixes<commit_after><?php

namespace Columnis\Model;

use Zend\Cache\Storage\StorageInterface;
use GuzzleHttp\Subscriber\Cache\CacheStorageInterface;
use GuzzleHttp\Message\RequestInterface;
use GuzzleHttp\Message\ResponseInterface;

class ZfCacheAdapter implements CacheStorageInterface {

    /**
     *
     * @var StorageInterface 
     */
    private $storageCache = null;

    /**
     * @param StorageInterface $cache Zend Framework 2 cache adapter
     */
    public function __construct(StorageInterface $cache) {
        $this->storageCache = $cache;
    }

    public function contains(RequestInterface $request) {
        return $this->storageCache->hasItem($this->buildKey($request->getUrl()));
    }

    public function cache(RequestInterface $request, ResponseInterface $response) {
        return $this->storageCache->setItem($this->buildKey($request->getUrl()), $response);
    }

    public function delete(RequestInterface $request) {
        return $this->storageCache->removeItem($this->buildKey($request->getUrl()));
    }

    public function fetch(RequestInterface $request) {
        return $this->storageCache->getItem($this->buildKey($request->getUrl()));
    }

    public function purge($url) {
        return $this->storageCache->removeItem($this->buildKey($url));
    }

    /**
     * @param string $url
     */
    private function buildKey($url) {
        return md5($url);
    }
}

?>
{'fraction_non_alphanumeric': 0.13009571074087203, 'fraction_numerical': 0.0014179369018078695, 'mean_word_length': 3.618657937806874, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 45, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3222233', 'n_tokens_mistral': 781, 'n_tokens_neox': 749, 'n_words': 146}