Test Failed
Push — master ( d3c8d8...d4fc42 )
by JAIME ELMER
02:02
created

src/F72X.php (2 issues)

Labels
1
<?php
2
3
namespace F72X;
4
5
use F72X\Exception\ConfigException;
6
7
class F72X {
8
9
    private static $production;
10
    private static $requiredConfigFields = [
11
        'RUC',
12
        'RAZON_SOCIAL',
13
        'NOMBRE_COMERCIAL',
14
        'USUARIO_SOL',
15
        'CLAVE_SOL',
16
        'CODIGO_DOMICILIO_FISCAL',
17
        'RUTA_CERTIFICADO',
18
        'RUTA_REPOSITORIO'
19
    ];
20
21
    /**
22
     * 
23
     * @param boolean $config
24
     * @param type $prodMode
0 ignored issues
show
The type F72X\type was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
25
     */
26
    public static function init($config, $prodMode = false) {
27
        self::$production = $prodMode;
28
        self::validateConfig($config);
29
        Company::setConfig($config);
0 ignored issues
show
$config of type boolean is incompatible with the type array expected by parameter $config of F72X\Company::setConfig(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

29
        Company::setConfig(/** @scrutinizer ignore-type */ $config);
Loading history...
30
    }
31
32
    public static function isProductionMode() {
33
        return self::$production;
34
    }
35
36
    private static function validateConfig($config) {
37
        foreach (self::$requiredConfigFields as $field) {
38
            if (!isset($config[$field])) {
39
                throw new ConfigException(sprintf('La propiedad %s es obligatoria, por favor revise su cofiguración!', $field));
40
            }
41
        }
42
    }
43
44
}
45