8000 merged branch canni/fix_type_hint (PR #2912) · symfony/symfony@bbec4bb · GitHub
[go: up one dir, main page]

Skip to content

Commit bbec4bb

Browse files
committed
merged branch canni/fix_type_hint (PR #2912)
Commits ------- e417153 [BugFix][Console] Fix type hint for output formatter Discussion ---------- [BugFix][Console] Fix type hint for OutputFormatter in OutputStream constructors I consider this as a bug, cause it disables ability to change formatter implementation BugFix: yes Feature addition: no Sysmfony2 test pass: yes --------------------------------------------------------------------------- by fabpot at 2011/12/18 00:23:05 -0800 It's not a bug fix as existing code that extend these classes will now fail. --------------------------------------------------------------------------- by stof at 2011/12/18 03:51:38 -0800 @fabpot does the constructor enforces its signature for child classes ? I don't think so.
2 parents 997f354 + e417153 commit bbec4bb

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/Symfony/Component/Console/Output/ConsoleOutput.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
namespace Symfony\Component\Console\Output;
1313

14-
use Symfony\Component\Console\Formatter\OutputFormatter;
14+
use Symfony\Component\Console\Formatter\OutputFormatterInterface;
1515

1616
/**
1717
* ConsoleOutput is the default class for all CLI output. It uses STDOUT.
@@ -40,7 +40,7 @@ class ConsoleOutput extends StreamOutput
4040
*
4141
* @api
4242
*/
43-
public function __construct($verbosity = self::VERBOSITY_NORMAL, $decorated = null, OutputFormatter $formatter = null)
43+
public function __construct($verbosity = self::VERBOSITY_NORMAL, $decorated = null, OutputFormatterInterface $formatter = null)
4444
{
4545
parent::__construct(fopen('php://stdout', 'w'), $verbosity, $decorated, $formatter);
4646
}

src/Symfony/Component/Console/Output/StreamOutput.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
namespace Symfony\Component\Console\Output;
1313

14-
use Symfony\Component\Console\Formatter\OutputFormatter;
14+
use Symfony\Component\Console\Formatter\OutputFormatterInterface;
1515

1616
/**
1717
* StreamOutput writes the output to a given stream.
@@ -45,7 +45,7 @@ class StreamOutput extends Output
4545
*
4646
* @api
4747
*/
48-
public function __construct($stream, $verbosi 5289 ty = self::VERBOSITY_NORMAL, $decorated = null, OutputFormatter $formatter = null)
48+
public function __construct($stream, $verbosity = self::VERBOSITY_NORMAL, $decorated = null, OutputFormatterInterface $formatter = null)
4949
{
5050
if (!is_resource($stream) || 'stream' !== get_resource_type($stream)) {
5151
throw new \InvalidArgumentException('The StreamOutput class needs a stream as its first argument.');

0 commit comments

Comments
 (0)
0