GameMasterExtractor   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getGameMasterJson() 0 7 2
A getGameMasterJsonCollection() 0 7 2
1
<?php
2
3
/*
4
 * (c) Jérémy Marodon <[email protected]>
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 */
8
9
namespace Th3Mouk\PokemonGoIVCalculator\Extractors;
10
11
use Illuminate\Support\Collection;
12
13
class GameMasterExtractor extends BaseExtractor
14
{
15
    private const FILE_PATH = __DIR__.'/../../datas/gamemaster.json';
16
17
    protected $json = null;
18
19
    /**
20
     * @var Collection
21
     */
22
    protected $collection = null;
23
24
    public function getGameMasterJson()
25
    {
26
        if (null === $this->json) {
27
            $this->json = $this->loadJson(self::FILE_PATH)->itemTemplates;
28
        }
29
        return $this->json;
30
    }
31
32
    public function getGameMasterJsonCollection(): Collection
33
    {
34
        if (null === $this->collection) {
35
            $this->collection = new Collection($this->getGameMasterJson());
36
        }
37
        return $this->collection;
38
    }
39
}
40