Completed
Push — master ( 054527...be0150 )
by Milan
01:52
created

Filename::createUniqueName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 5
rs 9.4285
c 1
b 0
f 0
cc 1
eloc 3
nc 1
nop 2
1
<?php
2
3
namespace h4kuna\Upload\Store;
4
5
use Nette\Http;
6
7
class Filename
8
{
9
	/**
10
	 * @param Http\FileUpload $fileUpload
11
	 * @param string $name - name of Upload service
12
	 * @return string
13
	 */
14
	public function createUniqueName(Http\FileUpload $fileUpload, $name)
0 ignored issues
show
Unused Code introduced by
The parameter $name is not used and could be removed.

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

Loading history...
15
	{
16
		$ext = pathinfo($fileUpload->getName(), PATHINFO_EXTENSION);
17
		return sha1(microtime(true) . '.' . $fileUpload->getName()) . '.' . $ext;
18
	}
19
}