for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* @copyright Copyright (c) Flipbox Digital Limited
* @license https://github.com/flipbox/hubspot/blob/master/LICENSE.md
* @link https://github.com/flipbox/hubspot
*/
namespace Flipbox\HubSpot\Criteria;
use Flipbox\HubSpot\HubSpot;
use Psr\SimpleCache\CacheInterface;
* @author Flipbox Factory <[email protected]>
* @since 2.0.0
trait CacheTrait
{
* @var CacheInterface|null
protected $cache;
* @param $value
* @return $this
public function cache($value)
return $this->setCache($value);
}
public function setCache($value)
$this->cache = $value;
return $this;
* @return CacheInterface
public function getCache(): CacheInterface
return $this->cache = $this->resolveCache($this->cache);
* @param $cache
protected function resolveCache($cache): CacheInterface
if ($cache instanceof CacheInterface) {
return $cache;
return HubSpot::getCache();