4 * This file is part of the Behat Testwork.
5 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
7 * For the full copyright and license information, please view the LICENSE
8 * file that was distributed with this source code.
11 namespace Behat\Testwork\Filesystem;
13 use Symfony\Component\Console\Output\OutputInterface;
16 * Logs filesystem operations to the console.
18 * @author Konstantin Kudryashov <ever.zet@gmail.com>
20 final class ConsoleFilesystemLogger implements FilesystemLogger
27 * @var OutputInterface
34 * @param string $basePath
35 * @param OutputInterface $output
37 public function __construct($basePath, OutputInterface $output)
39 $this->basePath = $basePath;
40 $this->output = $output;
46 public function directoryCreated($path, $reason)
48 $this->output->writeln(
50 '<info>+d</info> %s - %s',
51 str_replace($this->basePath . DIRECTORY_SEPARATOR, '', realpath($path)),
60 public function fileCreated($path, $reason)
62 $this->output->writeln(
64 '<info>+f</info> %s - %s',
65 str_replace($this->basePath . DIRECTORY_SEPARATOR, '', realpath($path)),
74 public function fileUpdated($path, $reason)
76 $this->output->writeln(
78 '<info>u</info> %s - %s',
79 str_replace($this->basePath . DIRECTORY_SEPARATOR, '', realpath($path)),