private $resource;
/**
- * Constructor.
- *
* @param string $resource The file path to the resource
*
* @throws \InvalidArgumentException
*/
public function isFresh($timestamp)
{
- return file_exists($this->resource) && @filemtime($this->resource) <= $timestamp;
+ return false !== ($filemtime = @filemtime($this->resource)) && $filemtime <= $timestamp;
}
public function serialize()