FormatFactory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A from() 0 9 2
1
<?php
2
3
namespace Leankoala\HealthFoundation\Config;
4
5
use Leankoala\HealthFoundation\Result\Format\Ietf\IetfFormat;
6
use PhmLabs\Components\Init\Init;
7
8
class FormatFactory
9
{
10
    /**
11
     * @param $configArray
12
     * @return IetfFormat
13
     */
14
    public static function from($configArray)
15
    {
16
        if (array_key_exists('format', $configArray)) {
17
            $format = Init::initialize($configArray['format']);
18
        } else {
19
            $format = new IetfFormat();
20
        }
21
22
        return $format;
23
    }
24
}
25