JsonDecoder   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
eloc 6
c 1
b 0
f 1
dl 0
loc 17
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A decode() 0 5 1
1
<?php
2
/**
3
 * Copyright © Vaimo Group. All rights reserved.
4
 * See LICENSE_VAIMO.txt for license details.
5
 */
6
namespace Vaimo\ComposerChangelogs\Decoders;
7
8
class JsonDecoder
9
{
10
    /**
11
     * @var \Seld\JsonLint\JsonParser
12
     */
13
    private $jsonLinter;
14
    
15
    public function __construct()
16
    {
17
        $this->jsonLinter = new \Seld\JsonLint\JsonParser();
18
    }
19
20
    public function decode($json)
21
    {
22
        return $this->jsonLinter->parse(
23
            $json,
24
            \Seld\JsonLint\JsonParser::PARSE_TO_ASSOC
25
        );
26
    }
27
}
28