StreamOutput   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 1
dl 0
loc 18
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A write() 0 4 1
A openStream() 0 4 1
1
<?php
2
/*
3
 * PHP SAPI Library
4
 * Copyright (C) 2020 Christian Neff
5
 *
6
 * Permission to use, copy, modify, and/or distribute this software for
7
 * any purpose with or without fee is hereby granted, provided that the
8
 * above copyright notice and this permission notice appear in all copies.
9
 */
10
11
namespace Secondtruth\SAPI\Output;
12
13
use Secondtruth\SAPI\OutputInterface;
14
use Secondtruth\SAPI\Stream\AbstractStream;
15
16
/**
17
 * The StreamOutput class.
18
 *
19
 * @author Christian Neff <[email protected]>
20
 */
21
class StreamOutput extends AbstractStream implements OutputInterface
22
{
23
    /**
24
     * {@inheritdoc}
25
     */
26
    public function write($data)
27
    {
28
        fwrite($this->stream, $data);
29
    }
30
31
    /**
32
     * {@inheritdoc}
33
     */
34
    protected function openStream(string $stream)
35
    {
36
        return fopen($stream, 'w');
37
    }
38
}
39