Completed
Pull Request — master (#90)
by Peter
07:18 queued 06:07
created

LocationTooLongException::longLocation()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 9
ccs 7
cts 7
cp 1
rs 9.9666
c 0
b 0
f 0
cc 1
nc 1
nop 2
crap 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\Url\Exception;
11
12
class LocationTooLongException extends \DomainException
13
{
14
    /**
15
     * @param string $location
16
     * @param int    $max_length
17
     *
18
     * @return static
19
     */
20 1
    public static function longLocation($location, $max_length)
21
    {
22 1
        return new static(sprintf(
23 1
            'The location "%s" must be less than "%d" characters, got "%d" instead.',
24 1
            $location,
25 1
            $max_length,
26 1
            strlen($location)
27 1
        ));
28
    }
29
}
30