Completed
Push — master ( 6aa3fc...c7d0c1 )
by Alexei
9s
created

Subdomain::create()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 12
Code Lines 7

Duplication

Lines 12
Ratio 100 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 12
loc 12
rs 9.4285
cc 2
eloc 7
nc 2
nop 1
1
<?php
2
// Copyright 1999-2016. Parallels IP Holdings GmbH.
3
4
namespace PleskX\Api\Operator;
5
use PleskX\Api\Struct\Subdomain as Struct;
6
7 View Code Duplication
class Subdomain extends \PleskX\Api\Operator
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
8
{
9
    /**
10
     * @param array $properties
11
     * @return Struct\Info
12
     */
13
    public function create($properties)
14
    {
15
        $packet = $this->_client->getPacket();
16
        $info = $packet->addChild($this->_wrapperTag)->addChild('add');
17
18
        foreach ($properties as $name => $value) {
19
            $info->addChild($name, $value);
20
        }
21
22
        $response = $this->_client->request($packet);
23
        return new Struct\Info($response);
24
    }
25
26
    /**
27
     * @param string $field
28
     * @param integer|string $value
29
     * @return bool
30
     */
31
    public function delete($field, $value)
32
    {
33
        return $this->_delete($field, $value);
34
    }
35
}
36