[FileCache] Rename 'prepare' to 'setParameters'

This is a cosmetic change to use the same naming convention for
all methods.
This commit is contained in:
logmanoriginal 2016-10-08 15:04:14 +02:00
parent 0998cbde9d
commit 5ccde61a19
2 changed files with 7 additions and 3 deletions

View file

@ -55,7 +55,11 @@ class FileCache implements CacheInterface {
} }
} }
public function prepare(array $param){ /**
* Set HTTP GET parameters
* @return self
*/
public function setParameters(array $param){
$this->param = $param; $this->param = $param;
return $this; return $this;
@ -68,7 +72,7 @@ class FileCache implements CacheInterface {
*/ */
protected function isPrepareCache(){ protected function isPrepareCache(){
if(is_null($this->param)){ if(is_null($this->param)){
throw new \Exception('Please feed "prepare" method before try to load'); throw new \Exception('Please feed "setParameters" method before try to load');
} }
return true; return true;

View file

@ -138,7 +138,7 @@ abstract class BridgeAbstract implements BridgeInterface {
*/ */
public function setDatas(array $inputs){ public function setDatas(array $inputs){
if(!is_null($this->cache)){ if(!is_null($this->cache)){
$this->cache->prepare($inputs); $this->cache->setParameters($inputs);
$time = $this->cache->getTime(); $time = $this->cache->getTime();
if($time !== false if($time !== false
&& (time() - static::CACHE_TIMEOUT < $time) && (time() - static::CACHE_TIMEOUT < $time)