Code Duplication    Length = 24-24 lines in 2 locations

devices/ms/Device_Vista7.php 1 location

@@ 443-466 (lines=24) @@
440
        fclose($fileHandle);
441
    }
442
443
    private function writeProfilesNSH($wlanProfiles, $caArray) {
444
        $this->loggerInstance->debug(4, "writeProfilesNSH");
445
        $this->loggerInstance->debug(4, $wlanProfiles);
446
        $contentWlan = '';
447
        foreach ($wlanProfiles as $wlanProfile) {
448
            $contentWlan .= "!insertmacro define_wlan_profile $wlanProfile\n";
449
        }
450
451
        file_put_contents('profiles.nsh', $contentWlan);
452
        
453
        $contentCerts = '';
454
        $fileHandleCerts = fopen('certs.nsh', 'w');
455
        if ($fileHandleCerts === FALSE) {
456
            throw new Exception("Unable to open new file certs.nsh to write CAs!");
457
        }
458
        if ($caArray) {
459
            foreach ($caArray as $certAuthority) {
460
                $store = $certAuthority['root'] ? "root" : "ca";
461
                $contentCerts .= '!insertmacro install_ca_cert "' . $certAuthority['file'] . '" "' . $certAuthority['sha1'] . '" "' . $store . "\"\n";
462
            }
463
            fwrite($fileHandleCerts, $contentCerts);
464
        }
465
        fclose($fileHandleCerts);
466
    }
467
468
    private function copyFiles($eap) {
469
        $this->loggerInstance->debug(4, "copyFiles start\n");

devices/ms/Device_W8_10.php 1 location

@@ 462-485 (lines=24) @@
459
        $this->loggerInstance->debug(2, "Installer has been written into directory $this->FPATH\n");
460
    }
461
462
    private function writeProfilesNSH($wlanProfiles, $caArray) {
463
        $this->loggerInstance->debug(4, "writeProfilesNSH");
464
        $this->loggerInstance->debug(4, $wlanProfiles);
465
        $fcontentsProfile = '';
466
        foreach ($wlanProfiles as $wlanProfile) {
467
            $fcontentsProfile .= "!insertmacro define_wlan_profile $wlanProfile\n";
468
        }
469
470
        file_put_contents('profiles.nsh', $fcontentsProfile);
471
472
        $fcontentsCerts = '';
473
        $fileHandleCerts = fopen('certs.nsh', 'w');
474
        if ($fileHandleCerts === FALSE) {
475
            throw new Exception("Unable to open new certs.nsh file for writing CAs.");
476
        }
477
        if ($caArray) {
478
            foreach ($caArray as $certAuthority) {
479
                $store = $certAuthority['root'] ? "root" : "ca";
480
                $fcontentsCerts .= '!insertmacro install_ca_cert "' . $certAuthority['file'] . '" "' . $certAuthority['sha1'] . '" "' . $store . "\"\n";
481
            }
482
            fwrite($fileHandleCerts, $fcontentsCerts);
483
        }
484
        fclose($fileHandleCerts);
485
    }
486
487
    private function writeMainNSH($eap, $attr) {
488
        $this->loggerInstance->debug(4, "writeMainNSH");