Dictionary::__clone()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 3
rs 10
c 1
b 0
f 0
cc 1
eloc 1
nc 1
nop 0
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