Completed
Push — master ( a50e59...22377b )
by Freek
10:42
created

TemporaryDirectory::create()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Spatie\MediaLibrary\Helpers;
4
5
use Spatie\TemporaryDirectory\TemporaryDirectory as BaseTemporaryDirectory;
6
7
class TemporaryDirectory
8
{
9
    public static function create(): BaseTemporaryDirectory
10
    {
11
        return new BaseTemporaryDirectory(static::getTemporaryDirectoryPath());
12
    }
13
14
    protected static function getTemporaryDirectoryPath(): string
15
    {
16
        $path = config('medialibrary.temporary_directory_path') ?? storage_path('medialibrary/temp');
17
18
        return $path.DIRECTORY_SEPARATOR.str_random(32);
0 ignored issues
show
Deprecated Code introduced by
The function str_random() has been deprecated with message: Str::random() should be used directly instead. Will be removed in Laravel 5.9.

This function has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed from the class and what other function to use instead.

Loading history...
19
    }
20
}
21