Code Duplication    Length = 11-11 lines in 2 locations

phpsysinfo/includes/class.Parser.inc.php 1 location

@@ 38-48 (lines=11) @@
35
        $arrResults = array();
36
        if (CommonFunctions::executeProgram("lspci", "", $strBuf, $debug)) {
37
            $arrLines = preg_split("/\n/", $strBuf, -1, PREG_SPLIT_NO_EMPTY);
38
            foreach ($arrLines as $strLine) {
39
                $arrParams = preg_split('/ /', trim($strLine), 2);
40
                if (count($arrParams) == 2)
41
                   $strName = $arrParams[1];
42
                else
43
                   $strName = "unknown";
44
                $strName = preg_replace('/\(.*\)/', '', $strName);
45
                $dev = new HWDevice();
46
                $dev->setName($strName);
47
                $arrResults[] = $dev;
48
            }
49
        }
50
51
        return $arrResults;

phpsysinfo/includes/os/class.Minix.inc.php 1 location

@@ 132-142 (lines=11) @@
129
    {
130
        if (CommonFunctions::rfts('/proc/pci', $strBuf, 0, 4096, false)) {
131
            $arrLines = preg_split("/\n/", $strBuf, -1, PREG_SPLIT_NO_EMPTY);
132
            foreach ($arrLines as $strLine) {
133
               $arrParams = preg_split('/\s+/', trim($strLine), 4);
134
               if (count($arrParams) == 4)
135
                  $strName = $arrParams[3];
136
               else
137
                  $strName = "unknown";
138
               $strName = preg_replace('/\(.*\)/', '', $strName);
139
               $dev = new HWDevice();
140
               $dev->setName($strName);
141
               $arrResults[] = $dev;
142
            }
143
            foreach ($arrResults as $dev) {
144
                $this->sys->setPciDevices($dev);
145
            }