GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

FileSystemLoader   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 3
dl 0
loc 37
rs 10
c 0
b 0
f 0
ccs 9
cts 9
cp 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A load() 0 10 2
1
<?php
2
namespace HtImgModule\Imagine\Loader;
3
4
use HtImgModule\Imagine\Resolver\ResolverInterface;
5
use HtImgModule\Exception;
6
7
class FileSystemLoader implements LoaderInterface
8
{
9
    /**
10
     * @var ResolverInterface
11
     */
12
    protected $resolver;
13
14
    /**
15
     * @var SimpleFileSystemLoader
16
     */
17
    protected $loader;
18
19
    /**
20
     * Constructor
21
     *
22
     * @param ResolverInterface $resolver
23
     */
24 3
    public function __construct(ResolverInterface $resolver)
25
    {
26 3
        $this->resolver = $resolver;
27 3
        $this->loader   = new SimpleFileSystemLoader(null);
28 3
    }
29
30
    /**
31
     * {@inheritDoc}
32
     */
33 2
    public function load($path)
34
    {
35 2
        $imagePath = $this->resolver->resolve($path);
36
37 2
        if (!$imagePath) {
38 1
            throw new Exception\ImageNotFoundException(sprintf('Cound not resolve image, "%s"', $path));
39
        }
40
41 1
        return $this->loader->load($imagePath);
42
    }
43
}
44