for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Opine\Cache;
class FileCache {
private $root;
private function getKeyFilePath (string $name):string
{
return $this->root . md5($name) . '.txt';
}
public function __construct (string $root)
$this->root = $root . '/var/cache/';
// just here for Memcache compatibilty
public function pconnect($host, $port):bool
$host
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.
$port
return true;
public function delete ($key):bool
$path = $this->getKeyFilePath($key);
if (!file_exists($path)) {
return false;
return unlink($path);
public function set($key, $value, $flag, $expire):bool
$flag
$expire
if (!is_string((string)$value)) {
$value = (string)$value;
file_put_contents($path, $value);
public function get ($key)
if (is_array($key)) {
$response = [];
foreach ($key as $value) {
$path = $this->getKeyFilePath($value);
$response[$value] = false;
continue;
$response[$value] = file_get_contents($path);
return $response;
return file_get_contents($path);
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.