Code Duplication    Length = 12-12 lines in 4 locations

src/PleskX/Api/Operator/Certificate.php 1 location

@@ 14-25 (lines=12) @@
11
     * @param array $properties
12
     * @return Struct\Info
13
     */
14
    public function generate($properties)
15
    {
16
        $packet = $this->_client->getPacket();
17
        $info = $packet->addChild($this->_wrapperTag)->addChild('generate')->addChild('info');
18
19
        foreach ($properties as $name => $value) {
20
            $info->addChild($name, $value);
21
        }
22
23
        $response = $this->_client->request($packet);
24
        return new Struct\Info($response);
25
    }
26
27
}
28

src/PleskX/Api/Operator/Customer.php 1 location

@@ 14-25 (lines=12) @@
11
     * @param array $properties
12
     * @return Struct\Info
13
     */
14
    public function create($properties)
15
    {
16
        $packet = $this->_client->getPacket();
17
        $info = $packet->addChild($this->_wrapperTag)->addChild('add')->addChild('gen_info');
18
19
        foreach ($properties as $name => $value) {
20
            $info->addChild($name, $value);
21
        }
22
23
        $response = $this->_client->request($packet);
24
        return new Struct\Info($response);
25
    }
26
27
    /**
28
     * @param string $field

src/PleskX/Api/Operator/DnsTemplate.php 1 location

@@ 14-25 (lines=12) @@
11
     * @param array $properties
12
     * @return Struct\Info
13
     */
14
    public function create(array $properties)
15
    {
16
        $packet = $this->_client->getPacket();
17
        $info = $packet->addChild($this->_wrapperTag)->addChild('add_rec');
18
19
        unset($properties['site-id'], $properties['site-alias-id']);
20
        foreach ($properties as $name => $value) {
21
            $info->addChild($name, $value);
22
        }
23
24
        return new Struct\Info($this->_client->request($packet));
25
    }
26
27
    /**
28
     * @param string $field

src/PleskX/Api/Operator/Reseller.php 1 location

@@ 14-25 (lines=12) @@
11
     * @param array $properties
12
     * @return Struct\Info
13
     */
14
    public function create($properties)
15
    {
16
        $packet = $this->_client->getPacket();
17
        $info = $packet->addChild($this->_wrapperTag)->addChild('add')->addChild('gen-info');
18
19
        foreach ($properties as $name => $value) {
20
            $info->addChild($name, $value);
21
        }
22
23
        $response = $this->_client->request($packet);
24
        return new Struct\Info($response);
25
    }
26
27
    /**
28
     * @param string $field