TemplateNotFoundException   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 21
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A create() 0 8 1
1
<?php
2
/* (c) Anton Medvedev <[email protected]>
3
 *
4
 * For the full copyright and license information, please view the LICENSE
5
 * file that was distributed with this source code.
6
 */
7
8
namespace Deployer\Initializer\Exception;
9
10
/**
11
 * Control template not found errors
12
 *
13
 * @author Vitaliy Zhuk <[email protected]>
14
 */
15
class TemplateNotFoundException extends \Exception
16
{
17
    /**
18
     * Create a new exception via template name
19
     *
20
     * @param string     $template
21
     * @param array      $availableTemplates
22
     * @param int        $code
23
     * @param \Exception $prev
24
     *
25
     * @return TemplateNotFoundException
26
     */
27 1
    public static function create($template, array $availableTemplates, $code = 0, \Exception $prev = null)
28
    {
29 1
        return new static(sprintf(
30 1
            'Not found template with name "%s". Available templates: "%s"',
31
            $template,
32 1
            implode('", "', $availableTemplates)
33
        ), $code, $prev);
34
    }
35
}
36