Code Duplication    Length = 11-12 lines in 3 locations

src/Api/Operator/ProtectedDirectory.php 2 locations

@@ 19-29 (lines=11) @@
16
     *
17
     * @return Struct\Info
18
     */
19
    public function add($name, $siteId, $header = '')
20
    {
21
        $packet = $this->_client->getPacket();
22
        $info = $packet->addChild($this->_wrapperTag)->addChild('add');
23
24
        $info->addChild('site-id', $siteId);
25
        $info->addChild('name', $name);
26
        $info->addChild('header', $header);
27
28
        return new Struct\Info($this->_client->request($packet));
29
    }
30
31
    /**
32
     * @param string $field
@@ 79-89 (lines=11) @@
76
     *
77
     * @return Struct\UserInfo
78
     */
79
    public function addUser($protectedDirectory, $login, $password)
80
    {
81
        $packet = $this->_client->getPacket();
82
        $info = $packet->addChild($this->_wrapperTag)->addChild('add-user');
83
84
        $info->addChild('pd-id', $protectedDirectory->id);
85
        $info->addChild('login', $login);
86
        $info->addChild('password', $password);
87
88
        return new Struct\UserInfo($this->_client->request($packet));
89
    }
90
91
    /**
92
     * @param string $field

src/Api/Operator/Webspace.php 1 location

@@ 37-48 (lines=12) @@
34
     *
35
     * @return Struct\PhpSettings
36
     */
37
    public function getPhpSettings($field, $value)
38
    {
39
        $packet = $this->_client->getPacket();
40
        $getTag = $packet->addChild($this->_wrapperTag)->addChild('get');
41
42
        $getTag->addChild('filter')->addChild($field, $value);
43
        $getTag->addChild('dataset')->addChild('php-settings');
44
45
        $response = $this->_client->request($packet, \PleskX\Api\Client::RESPONSE_FULL);
46
47
        return new Struct\PhpSettings($response);
48
    }
49
50
    /**
51
     * @param string $field