Completed
Push — master ( 2c84d0...dc4ad7 )
by Steve
04:23
created

AbstractComponent   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A getConfigPath() 0 5 1
1
<?php
2
/**
3
 * @package    Fuel\Foundation
4
 * @version    2.0
5
 * @author     Fuel Development Team
6
 * @license    MIT License
7
 * @copyright  2010 - 2016 Fuel Development Team
8
 * @link       http://fuelphp.com
9
 */
10
11
declare(strict_types=1);
12
13
namespace Fuel\Foundation;
14
15
use ReflectionClass;
16
17
abstract class AbstractComponent implements ComponentInterface
18
{
19
	/**
20
	 * Gets the directory where the component's configs can be found.
21
	 * This uses reflection so if you have a large number of components it would be advisable to extend this and use
22
	 * `__DIR__` to generate a return value.
23
	 *
24
	 * @return string
25
	 */
26
	public function getConfigPath() : string
27
	{
28
		$reflection = new ReflectionClass(static::class);
29
		return dirname($reflection->getFileName());
30
	}
31
}
32