Passed
Push — master ( 2b04c5...3174fa )
by Jesús
01:25 queued 12s
created

ConfigFactory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 8
c 2
b 0
f 0
dl 0
loc 20
ccs 7
cts 7
cp 1
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A createGacelaConfigFileFactory() 0 7 1
A createPathFinder() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Gacela\Framework\Config;
6
7
use Gacela\Framework\Config;
8
9
final class ConfigFactory
10
{
11
    /** @deprecated */
12
    private const GACELA_JSON_CONFIG_FILENAME = 'gacela.json';
13
14
    private const GACELA_PHP_CONFIG_FILENAME = 'gacela.php';
15
16 17
    public function createGacelaConfigFileFactory(): GacelaConfigFileFactoryInterface
17
    {
18
        /** @psalm-suppress DeprecatedConstant */
19 17
        return new GacelaConfigFileFactory(
20 17
            Config::getInstance()->getApplicationRootDir(),
21 17
            self::GACELA_PHP_CONFIG_FILENAME,
22 17
            self::GACELA_JSON_CONFIG_FILENAME
0 ignored issues
show
introduced by
The constant Gacela\Framework\Config\...LA_JSON_CONFIG_FILENAME has been deprecated. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

22
            /** @scrutinizer ignore-deprecated */ self::GACELA_JSON_CONFIG_FILENAME
Loading history...
23
        );
24
    }
25
26 10
    public function createPathFinder(): PathFinderInterface
27
    {
28 10
        return new PathFinder();
29
    }
30
}
31