FileNotFoundException   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
c 0
b 0
f 0
lcom 0
cbo 1
dl 31
loc 31
ccs 6
cts 6
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 6 6 1
A getPath() 4 4 1

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php
2
3
namespace League\Flysystem;
4
5
use Exception as BaseException;
6
7 View Code Duplication
class FileNotFoundException extends Exception
0 ignored issues
show
Duplication introduced by Frank de Jonge
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
8
{
9
    /**
10
     * @var string
11
     */
12
    protected $path;
13
14
    /**
15
     * Constructor.
16
     *
17
     * @param string     $path
18
     * @param int        $code
19
     * @param \Exception $previous
20
     */
21 18
    public function __construct($path, $code = 0, BaseException $previous = null)
22
    {
23 18
        $this->path = $path;
24
25 18
        parent::__construct('File not found at path: ' . $this->getPath(), $code, $previous);
26 18
    }
27
28
    /**
29
     * Get the path which was not found.
30
     *
31
     * @return string
32
     */
33 18
    public function getPath()
34
    {
35 18
        return $this->path;
36
    }
37
}
38