Completed
Pull Request — master (#20)
by Vladimir
02:43
created

FileAwareException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 27
ccs 0
cts 5
cp 0
rs 10
wmc 2
lcom 0
cbo 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getFileLocation() 0 4 1
A setFileLocation() 0 4 1
1
<?php
2
3
namespace allejo\stakx\Exception;
4
5
use Symfony\Component\Finder\SplFileInfo;
6
7
/**
8
 * Class FileAwareException
9
 *
10
 * These functions are not to be confused with getFile() which tracks the source file that triggered this exception,
11
 * where as these functions will keep track of what website file triggered the exception; e.g. a Twig template or
12
 * invalid JSON file
13
 *
14
 * @package allejo\stakx\Exception
15
 */
16
class FileAwareException extends \Exception
17
{
18
    /**
19
     * @var string|SplFileInfo
20
     */
21
    private $fileLocation;
22
23
    /**
24
     * Get the location of the website file that triggered this exception
25
     *
26
     * @return string
0 ignored issues
show
Documentation introduced by
Should the return type not be string|SplFileInfo?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
27
     */
28
    public function getFileLocation ()
29
    {
30
        return $this->fileLocation;
31
    }
32
33
    /**
34
     * Set the location of the website file that triggered this exception
35
     *
36
     * @param string|SplFileInfo $fileLocation
37
     */
38
    public function setFileLocation ($fileLocation)
39
    {
40
        $this->fileLocation = $fileLocation;
41
    }
42
}