NoVersionFoundException   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A forPath() 0 7 1
1
<?php
2
3
/*
4
 * This file is part of the vendor/project package.
5
 *
6
 * (c) Bernhard Schussek <[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 Puli\Repository\Api;
13
14
use Exception;
15
16
/**
17
 * Thrown when a change stream contains no version of a resource.
18
 *
19
 * @since  1.0
20
 *
21
 * @author Bernhard Schussek <[email protected]>
22
 */
23
class NoVersionFoundException extends ResourceNotFoundException
24
{
25
    /**
26
     * Creates a new exception for a resource path.
27
     *
28
     * @param string         $path  The path which was not found.
29
     * @param Exception|null $cause The exception that caused this exception.
30
     *
31
     * @return static The created exception.
32
     */
33 47
    public static function forPath($path, Exception $cause = null)
34
    {
35 47
        return new static(sprintf(
36 47
            'Could not find any version of path %s.',
37
            $path
38 47
        ), 0, $cause);
39
    }
40
}
41