Skip to content

Commit

Permalink
Fixed Swagger caching
Browse files Browse the repository at this point in the history
  • Loading branch information
kocsismate committed Apr 18, 2015
1 parent 076818b commit 5b013a9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

### 0.4.1 - 2015-04-18

- Fixed Swagger cache

### 0.4.0 - 2015-04-16

#### Added
Expand Down
16 changes: 8 additions & 8 deletions src/Swagger2/SwaggerSpec.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
namespace WoohooLabs\SpecGenerator\Swagger2;

use Doctrine\Common\Cache\CacheProvider;
use Doctrine\Common\Cache\Cache;
use WoohooLabs\SpecGenerator\Swagger2\Definitions\Definitions;
use WoohooLabs\SpecGenerator\Swagger2\ExternalDocs\ExternalDocs;
use WoohooLabs\SpecGenerator\Swagger2\Info\Info;
Expand All @@ -13,7 +13,7 @@
class SwaggerSpec implements SwaggerSpecInterface
{
/**
* @var \Doctrine\Common\Cache\CacheProvider
* @var \Doctrine\Common\Cache\Cache
*/
private $cache;

Expand Down Expand Up @@ -99,11 +99,11 @@ class SwaggerSpec implements SwaggerSpecInterface

/**
* @param callable $getSpec
* @param \Doctrine\Common\Cache\CacheProvider $cache
* @param \Doctrine\Common\Cache\Cache $cache
* @param string $cacheId
* @return array
*/
public static function getSpecification(callable $getSpec = null, CacheProvider $cache = null, $cacheId = "woohoolabs.specgenerator.swagger")
public static function getSpecification(callable $getSpec = null, Cache $cache = null, $cacheId = "woohoolabs.specgenerator.swagger")
{
if ($cache !== null && $cache->contains($cacheId)) {
return $cache->fetch($cacheId);
Expand All @@ -113,20 +113,20 @@ public static function getSpecification(callable $getSpec = null, CacheProvider
}

/**
* @param \Doctrine\Common\Cache\CacheProvider $cache
* @param \Doctrine\Common\Cache\Cache $cache
* @param string $cacheId
* @return $this
*/
public static function create(CacheProvider $cache = null, $cacheId = "woohoolabs.specgenerator.swagger")
public static function create(Cache $cache = null, $cacheId = "woohoolabs.specgenerator.swagger")
{
return new self($cache, $cacheId);
}

/**
* @param \Doctrine\Common\Cache\CacheProvider $cache
* @param \Doctrine\Common\Cache\Cache $cache
* @param string $cacheId
*/
public function __construct(CacheProvider $cache = null, $cacheId = "woohoolabs.specgenerator.swagger")
public function __construct(Cache $cache = null, $cacheId = "woohoolabs.specgenerator.swagger")
{
$this->cache = $cache;
$this->cacheId = $cacheId;
Expand Down

0 comments on commit 5b013a9

Please sign in to comment.