protected static function storeCache(\SwaggerValidator\Object\Swagger $swagger, \SwaggerValidator\Common\Context $context)
    {
        if (self::$cacheEnable !== true) {
            return $swagger;
        }

        if (!file_exists(self::$cachePath) && !touch(self::$cachePath)) {
            self::$cacheEnable = false;
            $context->throwException('Cannot Write Cache file : ' . self::$cachePath, __METHOD__, __LINE__);
        }

        $array = array(
            'ref' => \SwaggerValidator\Common\CollectionReference::getInstance(),
            'swg' => $swagger,
        );

        file_put_contents(self::$cachePath, '<?php return ' . var_export($array, true) . ';');
        touch(self::$cachePath);

        return $swagger;
    }