Dictionary   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A create() 0 6 2
A __construct() 0 8 1
A __clone() 0 3 1
1
<?php
2
3
namespace Gimei;
4
5
class Dictionary
6
{
7
    public $people;
8
    public $addresses;
9
10
    final public static function create()
11
    {
12
        static $instance = null;
13
14
        return $instance ?: $instance = new self();
15
    }
16
17
    final private function __construct()
18
    {
19
        $peopleJsonPath = __DIR__.'/data/people.json';
20
        $this->people = json_decode(file_get_contents($peopleJsonPath));
21
22
        $addressesJsonPath = __DIR__.'/data/addresses.json';
23
        $this->addresses = json_decode(file_get_contents($addressesJsonPath));
24
    }
25
26
    final private function __clone()
27
    {
28
    }
29
}
30