ParserFactory   A
last analyzed

Coupling/Cohesion

Components 0
Dependencies 3

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 3
dl 0
loc 19
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getInstance() 0 8 2
1
<?php
2
3
namespace League\CLImate\Decorator\Parser;
4
5
use League\CLImate\Util\System\System;
6
use League\CLImate\Decorator\Tags;
7
8
class ParserFactory
9
{
10
    /**
11
     * Get an instance of the appropriate Parser class
12
     *
13
     * @param System $system
14
     * @param array $current
15
     * @param Tags $tags
16
     * @return Parser
17
     */
18 556
    public static function getInstance(System $system, array $current, Tags $tags)
19
    {
20 556
        if ($system->hasAnsiSupport()) {
21 548
            return new Ansi($current, $tags);
22
        }
23
24 8
        return new NonAnsi($current, $tags);
25
    }
26
}
27