OriginalNameStrategy::transformFileName()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 3
Bugs 1 Features 0
Metric Value
cc 1
eloc 2
nc 1
nop 2
dl 0
loc 5
ccs 3
cts 3
cp 1
crap 1
rs 10
c 3
b 1
f 0
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