Cleanup the segment repositories

This code should now work on guzzle 4, guzzle 5 and guzzle 6.
This commit is contained in:
Graham Campbell
2015-05-28 19:17:23 +01:00
parent 65b1038b84
commit e93fda4d53
3 changed files with 21 additions and 11 deletions

View File

@@ -19,14 +19,18 @@ use Illuminate\Database\QueryException;
class CacheRepository implements RepositoryInterface
{
/**
* The underlying segment repository instance.
*
* @var \CachetHQ\Cachet\Segment\RepositoryInterface
*/
protected $repository;
/**
* Instantiates a new instance of the Cache Repository.
* Create a new segment cache repository instance.
*
* @param \CachetHQ\Cachet\Segment\RepositoryInterface $repository
*
* @return void
*/
public function __construct(RepositoryInterface $repository)
{
@@ -34,14 +38,12 @@ class CacheRepository implements RepositoryInterface
}
/**
* Determines whether to use the segment_write_key setting or to fetch a new.
* Returns the segment write key.
*
* @return string
*/
public function fetch()
{
$writeKey = null;
// We might not be setup yet.
try {
// Firstly, does the setting exist?