Passed
Push — master ( cc3241...e24646 )
by Eric
01:01 queued 13s
created

TemplateNotFoundException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 3
dl 0
loc 10
ccs 4
cts 4
cp 1
rs 10
c 1
b 0
f 1
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A forFilesystemTemplate() 0 3 1
A forDatabaseTemplate() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * This file is part of Esi\SimpleTpl.
7
 *
8
 * (c) 2006 - 2025 Eric Sizemore <[email protected]>
9
 *
10
 * This file is licensed under The MIT License. For the full copyright and
11
 * license information, please view the LICENSE.md file that was distributed
12
 * with this source code.
13
 */
14
15
namespace Esi\SimpleTpl\Exception;
16
17
use InvalidArgumentException;
18
19
class TemplateNotFoundException extends InvalidArgumentException
20
{
21 1
    public static function forDatabaseTemplate(string $templateName): self
22
    {
23 1
        return new self(\sprintf('Template "%s" does not exist.', $templateName));
24
    }
25
26 3
    public static function forFilesystemTemplate(string $templatePath): self
27
    {
28 3
        return new self(\sprintf('"%s" does not exist or is not a readable file.', $templatePath));
29
    }
30
}
31