Conditions | 3 |
Paths | 4 |
Total Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
36 | 180 | public function __construct($stream = 'php://stdout', $mode = 'a') |
|
37 | { |
||
38 | 180 | if (!is_resource($stream)) { |
|
39 | 8 | $stream = @fopen($stream, $mode); |
|
40 | 2 | } |
|
41 | |||
42 | 180 | if (!is_resource($stream)) { |
|
43 | 4 | throw new InvalidArgumentException(sprintf( |
|
44 | 4 | 'The stream "%s" cannot be created or opened', $stream |
|
45 | 1 | )); |
|
46 | } |
||
47 | |||
48 | 180 | $this->stream = $stream; |
|
49 | 45 | } |
|
50 | |||
74 | } |