File tree Expand file tree Collapse file tree 2 files changed +14
-10
lines changed Expand file tree Collapse file tree 2 files changed +14
-10
lines changed Original file line number Diff line number Diff line change 32
32
/**
33
33
* Set or get a global console writer.
34
34
*
35
- * @param null|Symfony\Component\Console\Output\ConsoleOutputInterface $writer
36
- * @return Symfony\Component\Console\Output\ConsoleOutputInterface
35
+ * @param null|OutputInterface $writer
36
+ * @return OutputInterface|\NullWriter|null
37
37
*/
38
38
function writer ($ writer = null )
39
39
{
@@ -47,9 +47,11 @@ function writer($writer = null)
47
47
return $ container ->make ('writer ' );
48
48
}
49
49
50
- return Container::getInstance ()->instance ('writer ' , $ writer );
50
+ $ container ->instance ('writer ' , $ writer );
51
+ return null ;
51
52
}
52
53
54
+
53
55
/**
54
56
* Output the given text to the console.
55
57
*
Original file line number Diff line number Diff line change @@ -6,12 +6,14 @@ trait UsesNullWriter
6
6
{
7
7
public function setNullWriter ()
8
8
{
9
- Container::getInstance ()->instance ('writer ' , new class
10
- {
11
- public function writeLn ($ msg )
12
- {
13
- // do nothing
14
- }
15
- });
9
+ Container::getInstance ()->instance ('writer ' , new NullWriter );
10
+ }
11
+ }
12
+
13
+ class NullWriter
14
+ {
15
+ public function writeLn ($ msg )
16
+ {
17
+ // do nothing
16
18
}
17
19
}
You can’t perform that action at this time.
0 commit comments