Hooks   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 2
dl 0
loc 26
c 0
b 0
f 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A get_file_storage_index() 0 6 2
A get_file_storage() 0 6 2
1
<?php
2
3
/*
4
 * This file is part of the Icybee package.
5
 *
6
 * (c) Olivier Laviale <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Icybee\Modules\Files;
13
14
use ICanBoogie\Core;
15
16
use Icybee\Modules\Files\Storage\FileStorage;
17
use Icybee\Modules\Files\Storage\FileStorageIndex;
18
19
class Hooks
20
{
21
	/**
22
	 * @param Core|Binding\CoreBindings $app
23
	 *
24
	 * @return FileStorageIndex
25
	 */
26
	static public function get_file_storage_index(Core $app)
0 ignored issues
show
Unused Code introduced by
The parameter $app 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...
27
	{
28
		static $index;
29
30
		return $index ?: $index = new FileStorageIndex(\ICanBoogie\REPOSITORY . 'files-index');
31
	}
32
33
	/**
34
	 * @param Core|Binding\CoreBindings $app
35
	 *
36
	 * @return FileStorage
37
	 */
38
	static public function get_file_storage(Core $app)
39
	{
40
		static $manager;
41
42
		return $manager ?: $manager = new FileStorage(\ICanBoogie\REPOSITORY . 'files', $app->file_storage_index);
43
	}
44
}
45