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

CompressionLevelException::invalid()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 9
rs 9.6666
c 1
b 0
f 0
cc 1
eloc 6
nc 1
nop 3
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 CompressionLevelException extends \InvalidArgumentException
13
{
14
    /**
15
     * @param int $current_level
16
     * @param int $min_level
17
     * @param int $max_level
18
     *
19
     * @return static
20
     */
21
    final public static function invalid($current_level, $min_level, $max_level)
22
    {
23
        return new static(sprintf(
24
            'Compression level "%s" must be in interval [%d, %d].',
25
            $current_level,
26
            $min_level,
27
            $max_level
28
        ));
29
    }
30
}
31