Completed
Branch develop (e10164)
by Benjamin
04:56
created

ObblmPackage   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 5
c 1
b 0
f 0
dl 0
loc 13
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getUrl() 0 3 1
A __construct() 0 4 1
1
<?php
2
3
namespace Obblm\Core\Service;
4
5
use Symfony\Component\Asset\PathPackage;
6
use Symfony\Component\Asset\VersionStrategy\EmptyVersionStrategy;
7
8
class ObblmPackage
9
{
10
    private $package;
11
12
    public function __construct($kernetProjectDir, $uploadDirectory, $publicUploadUrl = null)
0 ignored issues
show
Unused Code introduced by
The parameter $publicUploadUrl is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

12
    public function __construct($kernetProjectDir, $uploadDirectory, /** @scrutinizer ignore-unused */ $publicUploadUrl = null)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
13
    {
14
        $directory = str_replace($kernetProjectDir, '', $uploadDirectory);
15
        $this->package = new PathPackage($directory, new EmptyVersionStrategy());
16
    }
17
18
    public function getUrl(string $path)
19
    {
20
        return $this->package->getUrl($path);
21
    }
22
}
23