X-Git-Url: http://aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=inline;f=vendor%2Fbehat%2Fbehat%2Fsrc%2FBehat%2FTestwork%2FOutput%2FPrinter%2FFactory%2FFilesystemOutputFactory.php;fp=vendor%2Fbehat%2Fbehat%2Fsrc%2FBehat%2FTestwork%2FOutput%2FPrinter%2FFactory%2FFilesystemOutputFactory.php;h=0000000000000000000000000000000000000000;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hp=af982028c9f7ecc93d0537b8a1f9d861e0eadc3a;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0;p=yaffs-website diff --git a/vendor/behat/behat/src/Behat/Testwork/Output/Printer/Factory/FilesystemOutputFactory.php b/vendor/behat/behat/src/Behat/Testwork/Output/Printer/Factory/FilesystemOutputFactory.php deleted file mode 100644 index af982028c..000000000 --- a/vendor/behat/behat/src/Behat/Testwork/Output/Printer/Factory/FilesystemOutputFactory.php +++ /dev/null @@ -1,71 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Behat\Testwork\Output\Printer\Factory; - -use Behat\Testwork\Output\Exception\BadOutputPathException; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Output\StreamOutput; - -/** - * Creates an output stream for the filesystem. - * - * @author Wouter J - */ -class FilesystemOutputFactory extends OutputFactory -{ - private $fileName; - - public function setFileName($fileName) - { - $this->fileName = $fileName; - } - - /** - * Configure output stream parameters. - * - * @param OutputInterface $output - */ - protected function configureOutputStream(OutputInterface $output) - { - $verbosity = $this->getOutputVerbosity() ? OutputInterface::VERBOSITY_VERBOSE : OutputInterface::VERBOSITY_NORMAL; - $output->setVerbosity($verbosity); - } - - /** - * {@inheritDoc} - */ - public function createOutput($stream = null) - { - if (is_file($this->getOutputPath())) { - throw new BadOutputPathException( - 'Directory expected for the `output_path` option, but a filename was given.', - $this->getOutputPath() - ); - } elseif (!is_dir($this->getOutputPath())) { - mkdir($this->getOutputPath(), 0777, true); - } - - if (null === $this->fileName) { - throw new \LogicException('Unable to create file, no file name specified'); - } - - $filePath = $this->getOutputPath().'/'.$this->fileName; - - $stream = new StreamOutput( - fopen($filePath, 'w'), - StreamOutput::VERBOSITY_NORMAL, - false // a file is never decorated - ); - $this->configureOutputStream($stream); - - return $stream; - } -}