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

Oids::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

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