Test Failed
Push — master ( a5075e...c87161 )
by Zaahid
04:53
created

NonClosingLimitStream   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A close() 0 3 1
A detach() 0 3 1
1
<?php
2
/**
3
 * This file is part of the ZBateson\StreamDecorators project.
4
 *
5
 * @license http://opensource.org/licenses/bsd-license.php BSD
6
 */
7
namespace ZBateson\StreamDecorators;
8
9
use GuzzleHttp\Psr7\LimitStream;
10
11
/**
12
 * Extention of GuzzleHttp\Psr7\LimitStream that doesn't close the underlying
13
 * stream when closed or detached.
14
 *
15
 * @author Zaahid Bateson
16
 */
17
class NonClosingLimitStream extends LimitStream
18
{
19
    public function close()
20
    {
21
        $this->stream = null;
22
    }
23
24
    public function detach()
25
    {
26
        $this->stream = null;
27
    }
28
}
29