Completed
Push — master ( 66f9bc...5c75e4 )
by Garrett
02:20
created

Factory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 2
Bugs 0 Features 2
Metric Value
wmc 2
c 2
b 0
f 2
lcom 1
cbo 1
dl 0
loc 14
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A make() 0 4 1
1
<?php
2
3
namespace StringObject;
4
5
class Factory
6
{
7
    private $encoding;
8
9
    public function __construct($enc = StrObj::WINDOWS1252)
10
    {
11
        $this->encoding = $enc;
12
    }
13
14
    public function make($str)
15
    {
16
        return new StrObj($str, $this->encoding);
17
    }
18
}
19