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.
Completed
Pull Request — master (#202)
by Konstantin
09:30
created

UploadedFileProvider::uploadedFile()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 13
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 13
ccs 0
cts 7
cp 0
rs 9.4285
cc 2
eloc 6
nc 2
nop 2
crap 6
1
<?php
2
3
namespace Hautelook\AliceBundle\Faker\Provider;
4
5
use Symfony\Component\HttpFoundation\File\UploadedFile;
6
7
class UploadedFileProvider
8
{
9
    public static function uploadedFile($filePath, $originalName = null)
10
    {
11
        $tmpFilePath = tempnam(sys_get_temp_dir(), 'alice-');
12
        copy($filePath, $tmpFilePath);
13
14
        if (null === $originalName) {
15
            $originalName = basename($filePath);
16
        }
17
18
        //TODO: register shutdown function for removing
19
20
        return new UploadedFile($tmpFilePath, $originalName, null, null, null, true);
21
    }
22
}
23