Completed
Push — master ( 5dd7ca...fbd608 )
by Bocharsky
07:06 queued 11s
created

StorageException::translationExists()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
ccs 0
cts 4
cp 0
rs 10
cc 1
nc 1
nop 2
crap 2
1
<?php
2
3
/*
4
 * This file is part of the PHP Translation package.
5
 *
6
 * (c) PHP Translation team <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Translation\Common\Exception;
13
14
use Translation\Common\Exception;
15
16
/**
17
 * Storage related exceptions.
18
 *
19
 * @author Tobias Nyholm <[email protected]>
20
 */
21
class StorageException extends \RuntimeException implements Exception
22
{
23
    public static function translationExists(string $key, string $domain): self
24
    {
25
        return new self(sprintf('You cannot create a new translation with key "%s". That key does already exist in domain "%s".', $key, $domain));
26
    }
27
}
28