Code Duplication    Length = 13-14 lines in 3 locations

phpsysinfo/includes/mb/class.mbm5.inc.php 3 locations

@@ 64-77 (lines=14) @@
61
     *
62
     * @return void
63
     */
64
    private function _temperature()
65
    {
66
        for ($intPosi = 3; $intPosi < 6; $intPosi++) {
67
            if ($this->_buf_value[$intPosi] == 0) {
68
                continue;
69
            }
70
            preg_match("/([0-9\.])*/", str_replace(",", ".", $this->_buf_value[$intPosi]), $hits);
71
            $dev = new SensorDevice();
72
            $dev->setName($this->_buf_label[$intPosi]);
73
            $dev->setValue($hits[0]);
74
//            $dev->setMax(70);
75
            $this->mbinfo->setMbTemp($dev);
76
        }
77
    }
78
79
    /**
80
     * get fan information
@@ 84-97 (lines=14) @@
81
     *
82
     * @return void
83
     */
84
    private function _fans()
85
    {
86
        for ($intPosi = 13; $intPosi < 16; $intPosi++) {
87
            if (!isset($this->_buf_value[$intPosi])) {
88
                continue;
89
            }
90
            preg_match("/([0-9\.])*/", str_replace(",", ".", $this->_buf_value[$intPosi]), $hits);
91
            $dev = new SensorDevice();
92
            $dev->setName($this->_buf_label[$intPosi]);
93
            $dev->setValue($hits[0]);
94
//            $dev->setMin(3000);
95
            $this->mbinfo->setMbFan($dev);
96
        }
97
    }
98
99
    /**
100
     * get voltage information
@@ 104-116 (lines=13) @@
101
     *
102
     * @return void
103
     */
104
    private function _voltage()
105
    {
106
        for ($intPosi = 6; $intPosi < 13; $intPosi++) {
107
            if ($this->_buf_value[$intPosi] == 0) {
108
                continue;
109
            }
110
            preg_match("/([0-9\.])*/", str_replace(",", ".", $this->_buf_value[$intPosi]), $hits);
111
            $dev = new SensorDevice();
112
            $dev->setName($this->_buf_label[$intPosi]);
113
            $dev->setValue($hits[0]);
114
            $this->mbinfo->setMbVolt($dev);
115
        }
116
    }
117
118
    /**
119
     * get the information