Plan::list()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 6
Ratio 100 %

Importance

Changes 0
Metric Value
dl 6
loc 6
c 0
b 0
f 0
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
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\Plan as PlanEntity;
13
14
/**
15
 * @author Albert Leitato <[email protected]>
16
 */
17 View Code Duplication
class Plan extends AbstractApi
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...
18
{
19
    /**
20
     * Retrieve a list of all active plans.
21
     *
22
     * Plans that are no longer available will not be shown.
23
     *
24
     * @param string $type the type of plans to return
25
     *
26
     * @return PlanEntity[]
27
     */
28
    public function list($type = 'all')
29
    {
30
        $response = $this->adapter->get(\sprintf('%s/plans/list?type=%s', $this->endpoint, $type));
31
32
        return $this->handleResponse($response, PlanEntity::class, true);
33
    }
34
}
35