Factory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A getPreprocessor() 0 10 2
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace Foo\Pdo\Statement\Preprocessor;
6
7
use Foo\Pdo\Statement\Preprocessor;
8
use Foo\Pdo\Statement\Preprocessor\ArrayParameter\Associative;
9
use Foo\Pdo\Statement\Preprocessor\ArrayParameter\Numeric;
10
11
class Factory
12
{
13
    /** @var Preprocessor */
14
    protected static $instance;
15
16
    /**
17
     * @return Preprocessor
18
     */
19
    public static function getPreprocessor()
20
    {
21
        if (self::$instance instanceof Preprocessor) {
22
            return self::$instance;
23
        }
24
25
        self::$instance = new Preprocessor(new ArrayParameter(new Numeric(), new Associative()));
26
27
        return self::$instance;
28
    }
29
}
30