for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* This file is part of the 2amigos/yii2-flysystem-component project.
*
* (c) 2amigOS! <http://2amigos.us/>
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace dosamigos\flysystem\cache;
use League\Flysystem\Cached\Storage\AbstractCache;
use yii\caching\Cache;
class YiiCache extends AbstractCache
{
* @var Cache
protected $yiiCache;
* @var string
protected $key;
* @var integer
protected $duration;
* @param Cache $cache
* @param string $key
* @param integer $duration
public function __construct(Cache $cache, $key = 'flysystem', $duration = 0)
$this->cache = $cache;
$cache
object<yii\caching\Cache>
array
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..
$this->key = $key;
$this->duration = $duration;
}
* @inheritdoc
public function load()
$contents = $this->cache->get($this->key);
get
$this->cache
Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.
if ($contents !== false) {
$this->setFromStorage($contents);
public function save()
$this->cache->set($this->key, $this->getForStorage(), $this->duration);
set
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..