Ip::get()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 13
rs 9.8333
c 0
b 0
f 0
cc 2
nc 2
nop 0
1
<?php
2
// Copyright 1999-2021. Plesk International GmbH.
3
4
namespace PleskX\Api\Operator;
5
6
use PleskX\Api\Struct\Ip as Struct;
7
8
class Ip extends \PleskX\Api\Operator
9
{
10
    /**
11
     * @return Struct\Info[]
12
     */
13
    public function get()
14
    {
15
        $ips = [];
16
        $packet = $this->_client->getPacket();
17
        $packet->addChild($this->_wrapperTag)->addChild('get');
18
        $response = $this->_client->request($packet);
19
20
        foreach ($response->addresses->ip_info as $ipInfo) {
21
            $ips[] = new Struct\Info($ipInfo);
22
        }
23
24
        return $ips;
25
    }
26
}
27