Test Setup Failed
Push — master ( de37f4...b19653 )
by Tomasz
05:59
created

MsOneX   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
eloc 23
c 1
b 0
f 0
dl 0
loc 39
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getEapMethod() 0 8 1
A getEapHostConfig() 0 6 1
A getOneX() 0 8 1
A getEAPConfig() 0 5 1
1
<?php
2
3
/* 
4
 * To change this license header, choose License Headers in Project Properties.
5
 * To change this template file, choose Tools | Templates
6
 * and open the template in the editor.
7
 */
8
9
namespace devices\ms;
10
11
class MsOneX
12
{
13
    const MS_EAPHOST_NS = 'http://www.microsoft.com/provisioning/EapHostConfig';
14
    const MS_EAPCOMMON_NS = 'http://www.microsoft.com/provisioning/EapCommon';
15
    private $eapConfig;
16
17
    public function getOneX($eapConfig)
18
    {
19
        $this->eapConfig = $eapConfig;
20
        $element = new \core\DeviceXMLmain();
21
        $element->setChild('cacheUserData', 'true');
22
        $element->setChild('authMode', 'user');
23
        $element->setChild('EAPConfig', $this->getEAPConfig());
24
        return($element);
25
    }
26
    
27
    private function getEAPConfig()
28
    {
29
        $element = new \core\DeviceXMLmain();
30
        $element->setChild('EapHostConfig', $this->getEapHostConfig(), self::MS_EAPHOST_NS);
31
        return($element);
32
    }
33
    
34
    private function getEapHostConfig()
35
    {
36
        $element = new \core\DeviceXMLmain();
37
        $element->setChild('EapMethod', $this->getEapMethod());
38
        $element->setChild('Config', $this->eapConfig->config, self::MS_EAPHOST_NS);
39
        return($element);
40
    }
41
    
42
    private function getEapMethod()
43
    {
44
        $element = new \core\DeviceXMLmain();
45
        $element->setChild('Type', $this->eapConfig->type, self::MS_EAPCOMMON_NS);
46
        $element->setChild('VendorId',0, self::MS_EAPCOMMON_NS);
47
        $element->setChild('VendorType',0, self::MS_EAPCOMMON_NS);
48
        $element->setChild('AuthorId', $this->eapConfig->authorId, self::MS_EAPCOMMON_NS);
49
        return($element);
50
    }
51
}