Backup::list()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
c 0
b 0
f 0
rs 9.4285
cc 1
eloc 3
nc 1
nop 2
1
<?php
2
/*
3
 *   This file is part of the Vultr PHP library.
4
 *
5
 *   (c) Albert Leitato <[email protected]>
6
 *
7
 *   For the full copyright and license information, please view the LICENSE
8
 *   file that was distributed with this source code.
9
 */
10
namespace Vultr\Api;
11
12
use Vultr\Entity\Backup as BackupEntity;
13
14
/**
15
 * @author Albert Leitato <[email protected]>
16
 */
17
class Backup extends AbstractApi
18
{
19
    /**
20
     * List all backups on the current account.
21
     *
22
     * @param int    $sub_id    Filter result set to only contain backups of this subscription object
0 ignored issues
show
Bug introduced by
There is no parameter named $sub_id. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
23
     * @param string $backup_id filter result set to only contain this backup
0 ignored issues
show
Bug introduced by
There is no parameter named $backup_id. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
24
     * 
25
     * @return BackupEntity
26
     */
27
    public function list($subId = null, $backupId = null)
28
    {
29
        $backups = $this->adapter->get(\sprintf('%s/backup/list?SUBID=%d&BACKUPID=%s', $this->endpoint, $subId, $backupId));
30
31
        return $this->handleResponse($backups, BackupEntity::class, true);
0 ignored issues
show
Bug Compatibility introduced by
The expression $this->handleResponse($b...y\Backup::class, true); of type array|object adds the type array to the return on line 31 which is incompatible with the return type documented by Vultr\Api\Backup::list of type Vultr\Entity\Backup.
Loading history...
32
    }
33
}
34