ConfigRepository   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
dl 0
loc 24
rs 10
c 1
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A create() 0 7 1
1
<?php
2
3
namespace FigTree\Config;
4
5
use FigTree\Config\Contracts\{
6
	ConfigFactoryInterface,
7
	ConfigRepositoryInterface,
8
};
9
10
class ConfigRepository extends AbstractConfigRepository
11
{
12
	/**
13
	 * Helper method to construct a ConfigRepository instance with a default ConfigFactory.
14
	 *
15
	 * @return \FigTree\Config\Contracts\ConfigRepositoryInterface
16
	 */
17
	public static function create(): ConfigRepositoryInterface
18
	{
19
		$factory = new ConfigFactory();
20
21
		$instance = new static($factory);
22
23
		return $instance;
24
	}
25
26
	/**
27
	 * Construct an instance of ConfigRepository.
28
	 *
29
	 * @param \FigTree\Config\Contracts\ConfigFactoryInterface $factory
30
	 */
31
	public function __construct(ConfigFactoryInterface $factory)
32
	{
33
		$this->factory = $factory;
34
	}
35
}
36