Passed
Push — master ( acf268...8c2778 )
by Domenico
08:01 queued 16s
created

Config::getSchemaOrCallable()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 2
rs 10
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * @author hashashiyyin [email protected] / [email protected]
5
 * Date: 08/05/24
6
 * Time: 15:47
7
 *
8
 */
9
10
namespace Matecat\XmlParser;
11
12
/**
13
 *
14
 */
15
class Config {
16
17
    /**
18
     * @var bool
19
     */
20
    protected $allowDocumentType = false;
21
    /**
22
     * @var string|null
23
     */
24
    protected $setRootElement = null;
25
    /**
26
     * @var string|callable|null
27
     */
28
    protected $schemaOrCallable = null;
29
    /**
30
     * @var int
31
     */
32
    protected $XML_OPTIONS = 0;
33
34
    public function __construct( $setRootElement = null, $allowDocumentType = false, $XML_OPTIONS = 0, $schemaOrCallable = null ) {
35
        $this->XML_OPTIONS       = $XML_OPTIONS | ( defined( 'LIBXML_COMPACT' ) ? LIBXML_COMPACT : 0 );
36
        $this->setRootElement    = $setRootElement;
37
        $this->allowDocumentType = $allowDocumentType;
38
        $this->schemaOrCallable  = $schemaOrCallable;
39
    }
40
41
    /**
42
     * @return bool|mixed
43
     */
44
    public function getAllowDocumentType() {
45
        return $this->allowDocumentType;
46
    }
47
48
    /**
49
     * @return mixed|string|null
50
     */
51
    public function getSetRootElement() {
52
        return $this->setRootElement;
53
    }
54
55
    /**
56
     * @return callable|mixed|string|null
57
     */
58
    public function getSchemaOrCallable() {
59
        return $this->schemaOrCallable;
60
    }
61
62
    /**
63
     * @return int
64
     */
65
    public function getXML_OPTIONS() {
66
        return $this->XML_OPTIONS;
67
    }
68
69
}