for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace HotRodCli\Jobs\Filesystem;
use Symfony\Component\Finder\Finder;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\Filesystem\Exception\IOExceptionInterface;
class CopyFiles
{
protected $finder;
protected $filesystem;
public function __construct(Finder $finder, Filesystem $filesystem)
$this->finder = $finder;
$this->filesystem = $filesystem;
}
public function handle(string $src, string $dist)
if ($this->filesystem->exists($dist)) {
throw new \Exception('Such module already exists');
try {
$this->filesystem->mirror($src, $dist);
} catch (IOExceptionInterface $exception) {
throw new \Exception($exception->getMessage());