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

Filename   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
lcom 0
cbo 0
dl 0
loc 13
rs 10
c 1
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A createUniqueName() 0 5 1
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
}