Completed
Push — master ( 22ae1b...0d176d )
by Roberto
12:29
created

Oids   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getOid() 0 7 2
1
<?php
2
3
namespace NFePHP\Common\Certificate;
4
5
class Oids
6
{
7
    private static $oidsTable = array();
8
    
9
    /**
10
     * Construtor carrga a tabela de Oids do arquivo json
11
     */
12
    public function __construct()
13
    {
14
        $json = file_get_contents('oids.json');
15
        self::$oidsTable = json_decode($json, true);
0 ignored issues
show
Documentation Bug introduced by
It seems like json_decode($json, true) of type * is incompatible with the declared type array of property $oidsTable.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
16
    }
17
            
18
    /**
19
     * getOid
20
     * @param type $key
21
     * @return mixed
22
     */
23
    public static function getOid($key)
24
    {
25
        if (isset(self::$oidsTable[$key])) {
26
            return self::$oidsTable[$key];
27
        }
28
        return false;
29
    }
30
}
31