1
<?php
2
/**
3
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
 *
15
 * This software consists of voluntary contributions made by many individuals
16
 * and is licensed under the LGPL. For more information please see
17
 * <http://phing.info>.
18
 */
19

20
/**
21
 * Wrapper class for readers, which can be used to apply filters.
22
 *
23
 * @package phing.system.io
24
 */
25
class FilterReader extends Reader
26
{
27

28
    /**
29
     * @var Reader
30
     */
31
    protected $in;
32

33
    /**
34
     * @param Reader $in
35
     */
36 1
    public function __construct(Reader $in = null)
37
    {
38 1
        $this->in = $in;
39
    }
40

41
    /**
42
     * @param Reader $in
43
     */
44 1
    public function setReader(Reader $in)
45
    {
46 1
        $this->in = $in;
47
    }
48

49
    /**
50
     * @param int $n
51
     */
52 0
    public function skip($n)
53
    {
54 0
        $this->in->skip($n);
55
    }
56

57
    /**
58
     * Read data from source.
59
     * FIXME: Clean up this function signature, as it a) params aren't being used
60
     * and b) it doesn't make much sense.
61
     *
62
     * @param int $len
63
     * @return string
64
     * @throws IOException
65
     */
66 0
    public function read($len = null)
67
    {
68 0
        return $this->in->read($len);
69
    }
70

71 0
    public function reset()
72
    {
73 0
        $this->in->reset();
74
    }
75

76 1
    public function close()
77
    {
78 1
        return $this->in->close();
79
    }
80

81
    /**
82
     * @return string
83
     */
84 0
    public function getResource()
85
    {
86 0
        return $this->in->getResource();
87
    }
88
}

Read our documentation on viewing source code .

Loading