Passed
Push — main ( f82312...487838 )
by Miaad
10:48 queued 13s
created

easySQL::setAutoProcess()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
1
<?php
2
3
namespace BPT\settings;
4
5
use BPT\constants\dbTypes;
6
class easySQL {
7
    private array $settings = [
8
        'type' => dbTypes::MYSQL,
9
    ];
10
11
    /**
12
     * @param string $host
13
     *
14
     * @return $this
15
     */
16
    public function setHost (string $host): self {
17
        $this->settings['host'] = $host;
18
        return $this;
19
    }
20
21
    /**
22
     * @param string $port
23
     *
24
     * @return $this
25
     */
26
    public function setPort (string $port): self {
27
        $this->settings['port'] = $port;
28
        return $this;
29
    }
30
31
    /**
32
     * @param string $user
33
     *
34
     * @return $this
35
     */
36
    public function setUsername (string $user): self {
37
        $this->settings['user'] = $user;
38
        return $this;
39
    }
40
41
    /**
42
     * @param string $pass
43
     *
44
     * @return $this
45
     */
46
    public function setPassword (string $pass): self {
47
        $this->settings['pass'] = $pass;
48
        return $this;
49
    }
50
51
    /**
52
     * @param string $dbname
53
     *
54
     * @return $this
55
     */
56
    public function setDBName (string $dbname): self {
57
        $this->settings['dbname'] = $dbname;
58
        return $this;
59
    }
60
61
    /**
62
     * @param bool $auto_process
63
     *
64
     * @return $this
65
     */
66
    public function setAutoProcess (bool $auto_process): self {
67
        $this->settings['auto_process'] = $auto_process;
68
        return $this;
69
    }
70
71
    /**
72
     * @param bool $auto_load
73
     *
74
     * @return $this
75
     */
76
    public function setAutoLoad (bool $auto_load): self {
77
        $this->settings['auto_load'] = $auto_load;
78
        return $this;
79
    }
80
81
    /**
82
     * @return array
83
     */
84
    public function getSettings (): array {
85
        return $this->settings;
86
    }
87
}