for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace LazyEight\DiTesto\FileSystem;
use LazyEight\DiTesto\Interfaces\FileSystem\FileSystemHandlerInterface;
class FileSystemHandler implements FileSystemHandlerInterface
{
/**
* @inheritDoc
*/
public function exists(string $path): bool
return file_exists($path);
}
public function isReadable(string $path): bool
return is_readable($path);
public function isWritable(string $path): bool
if (!$this->exists($path) && is_writable($this->getPathName($path))) {
return true;
return is_writable($path);
public function getPathName(string $path): string
return dirname($path);
public function getFilename(string $path): string
return basename($path);
public function getSize(string $path): int
return filesize($path);
public function getType(string $path): string
return mime_content_type($path);
public function read(string $path): string
return file_get_contents($path);
public function write(string $path, string $content)
file_put_contents($path, $content);