for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php declare(strict_types=1);
namespace Logfile\Traits;
trait Path
{
protected $path = '';
public function hasPath(): bool
return !empty($this->path);
}
public function getPath(): string
return $this->path;
public function setPath(string $path): void
$realpath = realpath($path);
if (false === $realpath) {
throw new \InvalidArgumentException('Path does not exist: '.$path);
$this->path = $realpath . '/';