for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Karma\Filesystem\Adapters;
use Gaufrette\Adapter;
class SingleLocalFile implements Adapter
{
private
$filename,
Only declaring a single property per statement allows you to later on add doc comments more easily.
It is also recommended by PSR2, so it is a common style that many people expect.
$adapter;
public function __construct($filename, Adapter $adapter)
$this->filename = $filename;
$this->adapter = $adapter;
}
public function read($key)
if(! $this->exists($key))
return false;
return $this->adapter->read($key);
public function write($key, $content)
return $this->adapter->write($key, $content);
public function exists($key)
return $key === $this->filename;
public function keys()
return [$this->filename];
public function mtime($key)
return $this->adapter->mtime($key);
public function delete($key)
throw new \RuntimeException('Not implemented yet : ' . __METHOD__);
public function rename($sourceKey, $targetKey)
public function isDirectory($key)
Only declaring a single property per statement allows you to later on add doc comments more easily.
It is also recommended by PSR2, so it is a common style that many people expect.