OriginalNameStrategy   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 3
Bugs 1 Features 0
Metric Value
eloc 3
dl 0
loc 13
ccs 3
cts 3
cp 1
rs 10
c 3
b 1
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A transformFileName() 0 5 1
1
<?php
2
3
namespace ByTIC\MediaLibrary\Collections\UploadStrategy;
4
5
/**
6
 * Class OriginalNameStrategy.
7
 */
8
class OriginalNameStrategy extends AbstractStrategy
9
{
10
    /**
11
     * @param $path
12
     * @param $extension
13
     *
14
     * @return string
15
     */
16 2
    public static function transformFileName($path, $extension)
17
    {
18 2
        $name = pathinfo($path, PATHINFO_FILENAME);
19
20 2
        return $name . '.' . $extension;
0 ignored issues
show
Bug introduced by
Are you sure $name of type array|string can be used in concatenation? ( Ignorable by Annotation )

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

20
        return /** @scrutinizer ignore-type */ $name . '.' . $extension;
Loading history...
21
    }
22
}
23