Completed
Push — master ( 0d3592...0bb29a )
by Peter
06:28
created

StreamStateException   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 0
dl 0
loc 42
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A alreadyOpened() 0 4 1
A alreadyClosed() 0 4 1
A notOpened() 0 4 1
A notReady() 0 4 1
A notClosed() 0 4 1
1
<?php
2
/**
3
 * GpsLab component.
4
 *
5
 * @author    Peter Gribanov <[email protected]>
6
 * @copyright Copyright (c) 2011, Peter Gribanov
7
 * @license   http://opensource.org/licenses/MIT
8
 */
9
10
namespace GpsLab\Component\Sitemap\Stream\Exception;
11
12
class StreamStateException extends \RuntimeException
13
{
14
    /**
15
     * @return static
16
     */
17
    final public static function alreadyOpened()
18
    {
19
        return new static('Stream is already opened.');
20
    }
21
22
    /**
23
     * @return static
24
     */
25
    final public static function alreadyClosed()
26
    {
27
        return new static('Stream is already closed.');
28
    }
29
30
    /**
31
     * @return static
32
     */
33
    final public static function notOpened()
34
    {
35
        return new static('Stream not opened.');
36
    }
37
38
    /**
39
     * @return static
40
     */
41
    final public static function notReady()
42
    {
43
        return new static('Stream not ready.');
44
    }
45
46
    /**
47
     * @return static
48
     */
49
    final public static function notClosed()
50
    {
51
        return new static('Stream not closed.');
52
    }
53
}
54