mirror of
https://github.com/mrclay/minify.git
synced 2025-08-20 04:41:29 +02:00
Apply php-cs-fixer new rules
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* Class Minify_Cache_Memcache
|
||||
* @package Minify
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -19,13 +18,11 @@
|
||||
**/
|
||||
class Minify_Cache_Memcache implements Minify_CacheInterface
|
||||
{
|
||||
|
||||
/**
|
||||
* Create a Minify_Cache_Memcache object, to be passed to
|
||||
* Minify::setCache().
|
||||
*
|
||||
* @param Memcache $memcache already-connected instance
|
||||
*
|
||||
* @param int $expire seconds until expiration (default = 0
|
||||
* meaning the item will not get an expiration date)
|
||||
*/
|
||||
@@ -39,7 +36,6 @@ class Minify_Cache_Memcache implements Minify_CacheInterface
|
||||
* Write data to cache.
|
||||
*
|
||||
* @param string $id cache id
|
||||
*
|
||||
* @param string $data
|
||||
*
|
||||
* @return bool success
|
||||
@@ -58,29 +54,28 @@ class Minify_Cache_Memcache implements Minify_CacheInterface
|
||||
*/
|
||||
public function getSize($id)
|
||||
{
|
||||
if (! $this->_fetch($id)) {
|
||||
if (!$this->_fetch($id)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (function_exists('mb_strlen') && ((int)ini_get('mbstring.func_overload') & 2)) {
|
||||
if (function_exists('mb_strlen') && ((int) ini_get('mbstring.func_overload') & 2)) {
|
||||
return mb_strlen($this->_data, '8bit');
|
||||
} else {
|
||||
return strlen($this->_data);
|
||||
}
|
||||
|
||||
return strlen($this->_data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Does a valid cache entry exist?
|
||||
*
|
||||
* @param string $id cache id
|
||||
*
|
||||
* @param int $srcMtime mtime of the original source file(s)
|
||||
*
|
||||
* @return bool exists
|
||||
*/
|
||||
public function isValid($id, $srcMtime)
|
||||
{
|
||||
return ($this->_fetch($id) && ($this->_lm >= $srcMtime));
|
||||
return $this->_fetch($id) && ($this->_lm >= $srcMtime);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -105,13 +100,16 @@ class Minify_Cache_Memcache implements Minify_CacheInterface
|
||||
return $this->_fetch($id) ? $this->_data : '';
|
||||
}
|
||||
|
||||
private $_mc = null;
|
||||
private $_exp = null;
|
||||
private $_mc;
|
||||
|
||||
private $_exp;
|
||||
|
||||
// cache of most recently fetched id
|
||||
private $_lm = null;
|
||||
private $_data = null;
|
||||
private $_id = null;
|
||||
private $_lm;
|
||||
|
||||
private $_data;
|
||||
|
||||
private $_id;
|
||||
|
||||
/**
|
||||
* Fetch data and timestamp from memcache, store in instance
|
||||
@@ -127,7 +125,7 @@ class Minify_Cache_Memcache implements Minify_CacheInterface
|
||||
}
|
||||
|
||||
$ret = $this->_mc->get($id);
|
||||
if (false === $ret) {
|
||||
if ($ret === false) {
|
||||
$this->_id = null;
|
||||
|
||||
return false;
|
||||
|
Reference in New Issue
Block a user