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

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