Completed
Push — master ( 2704f9...f273e8 )
by Tomáš
02:19
created

src/OutputWriter.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
/**
4
 * This file is part of Zenify
5
 * Copyright (c) 2014 Tomas Votruba (http://tomasvotruba.cz)
6
 */
7
8
namespace Zenify\DoctrineMigrations;
9
10
use Doctrine\DBAL\Migrations\OutputWriter as DoctrineOutputWriter;
11
use Symfony\Component\Console\Output\ConsoleOutput;
12
use Symfony\Component\Console\Output\OutputInterface;
0 ignored issues
show
As per PSR2, there should be exactly one blank line after the last USE statement, 2 were found though.
Loading history...
13
14
15
final class OutputWriter extends DoctrineOutputWriter
16
{
17
18
	/**
19
	 * @var OutputInterface
20
	 */
21
	private $consoleOutput;
22
23
24 6
	public function setConsoleOutput(OutputInterface $consoleOutput)
25
	{
26 6
		$this->consoleOutput = $consoleOutput;
27 6
	}
28
29
30
	/**
31
	 * {@inheritdoc}
32
	 */
33 2
	public function write($message)
34
	{
35 2
		$this->getConsoleOutput()->writeln($message);
36 2
	}
37
38
39
	/**
40
	 * @return ConsoleOutput
41
	 */
42 2
	private function getConsoleOutput()
43
	{
44 2
		if ($this->consoleOutput === NULL) {
45 1
			$this->consoleOutput = new ConsoleOutput;
46 1
		}
47 2
		return $this->consoleOutput;
48
	}
49
50
}
51