UtilFactory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
c 1
b 0
f 1
lcom 0
cbo 0
dl 0
loc 23
ccs 0
cts 4
cp 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A maxUploadFilesize() 0 3 1
A humanFileSize() 0 3 1
1
<?php
2
/**
3
 * @author Lukas Reschke
4
 * @copyright 2015 Lukas Reschke [email protected]
5
 *
6
 * This file is licensed under the Affero General Public License version 3 or
7
 * later.
8
 * See the COPYING-README file.
9
 */
10
11
namespace OCA\Contacts\Factory;
12
13
use OCP\Util;
14
15
/**
16
 * @package OCA\Contacts\Factory
17
 */
18
class UtilFactory {
19
	/**
20
	 * calculates the maximum upload size respecting system settings, free space
21
	 * and user quota
22
	 *
23
	 * @param string $dir the current folder where the user currently operates
24
	 * @param int $free the number of bytes free on the storage holding $dir,
25
	 *                  if not set this will be received from the storage directly
26
	 * @return int number of bytes representing
27
	 */
28
	public function maxUploadFilesize($dir, $free = null) {
29
		return Util::maxUploadFilesize($dir, $free);
30
	}
31
32
	/**
33
	 * Make a human file size (2048 to 2 kB)
34
	 * @param int $bytes file size in bytes
35
	 * @return string a human readable file size
36
	 */
37
	public function humanFileSize($bytes) {
38
		return Util::humanFileSize($bytes);
39
	}
40
}
41