Passed
Push — master ( e1f86a...4e1a3a )
by Siad
05:23
created

Reader::mark()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 0
nc 1
nop 0
dl 0
loc 2
ccs 0
cts 1
cp 0
crap 2
rs 10
c 0
b 0
f 0
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
namespace Phing\Io;
21
22
/**
23
 * Abstract class for reading character streams.
24
 *
25
 * @author  Hans Lellelid <[email protected]>
26
 * @author  Yannick Lecaillez <[email protected]>
27
 * @package phing.system.io
28
 */
29
abstract class Reader
30
{
31
32
    /**
33
     * Read data from source.
34
     *
35
     * If length is specified, then only that number of chars is read,
36
     * otherwise stream is read until EOF.
37
     *
38
     * @param int $len
39
     * @return mixed
40
     * @throws IOException
41
     */
42
    abstract public function read($len = null);
43
44
    /**
45
     * Close stream.
46
     *
47
     * @throws IOException if there is an error closing stream
48
     */
49
    abstract public function close();
50
51
    /**
52
     * Returns the filename, url, etc. that is being read from.
53
     * This is critical for, e.g., ExpatParser's ability to know
54
     * the filename that is throwing an ExpatParserException, etc.
55
     *
56
     * @return string
57
     */
58
    abstract public function getResource();
59
60
    /**
61
     * Move stream position relative to current pos.
62
     *
63
     * @param int $n
64
     */
65
    public function skip($n)
0 ignored issues
show
Unused Code introduced by
The parameter $n is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

65
    public function skip(/** @scrutinizer ignore-unused */ $n)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
66
    {
67
    }
68
69
    /**
70
     * Reset the current position in stream to beginning or last mark (if supported).
71
     */
72
    public function reset()
73
    {
74
    }
75
76
    /**
77
     * If supported, places a "marker" (like a bookmark) at current stream position.
78
     * A subsequent call to reset() will move stream position back
79
     * to last marker (if supported).
80
     */
81
    public function mark()
82
    {
83
    }
84
85
    /**
86
     * Whether marking is supported.
87
     *
88
     * @return boolean
89
     */
90
    public function markSupported()
91
    {
92
        return false;
93
    }
94
95
    /**
96
     * Is stream ready for reading.
97
     *
98
     * @return boolean
99
     */
100
    public function ready()
101
    {
102
        return true;
103
    }
104
}
105