Code Duplication    Length = 11-11 lines in 4 locations

phpsysinfo/includes/mb/class.ohm.inc.php 4 locations

@@ 68-78 (lines=11) @@
65
     *
66
     * @return void
67
     */
68
    private function _temperature()
69
    {
70
        if ($this->_buf) foreach ($this->_buf as $buffer) {
71
            if ($buffer['SensorType'] == "Temperature") {
72
                $dev = new SensorDevice();
73
                $dev->setName($buffer['Parent'].' '.$buffer['Name']);
74
                $dev->setValue($buffer['Value']);
75
                $this->mbinfo->setMbTemp($dev);
76
            }
77
        }
78
    }
79
80
    /**
81
     * get voltage information
@@ 85-95 (lines=11) @@
82
     *
83
     * @return void
84
     */
85
    private function _voltage()
86
    {
87
        if ($this->_buf) foreach ($this->_buf as $buffer) {
88
            if ($buffer['SensorType'] == "Voltage") {
89
                $dev = new SensorDevice();
90
                $dev->setName($buffer['Parent'].' '.$buffer['Name']);
91
                $dev->setValue($buffer['Value']);
92
                $this->mbinfo->setMbVolt($dev);
93
            }
94
        }
95
    }
96
97
    /**
98
     * get fan information
@@ 102-112 (lines=11) @@
99
     *
100
     * @return void
101
     */
102
    private function _fans()
103
    {
104
        if ($this->_buf) foreach ($this->_buf as $buffer) {
105
            if ($buffer['SensorType'] == "Fan") {
106
                $dev = new SensorDevice();
107
                $dev->setName($buffer['Parent'].' '.$buffer['Name']);
108
                $dev->setValue($buffer['Value']);
109
                $this->mbinfo->setMbFan($dev);
110
            }
111
        }
112
    }
113
114
    /**
115
     * get power information
@@ 119-129 (lines=11) @@
116
     *
117
     * @return void
118
     */
119
    private function _power()
120
    {
121
        if ($this->_buf) foreach ($this->_buf as $buffer) {
122
            if ($buffer['SensorType'] == "Power") {
123
                $dev = new SensorDevice();
124
                $dev->setName($buffer['Parent'].' '.$buffer['Name']);
125
                $dev->setValue($buffer['Value']);
126
                $this->mbinfo->setMbPower($dev);
127
            }
128
        }
129
    }
130
131
    /**
132
     * get the information