Passed
Pull Request — master (#32)
by
unknown
02:26
created

ChannelsRequestParameters::setOrder()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 11
Code Lines 5

Duplication

Lines 11
Ratio 100 %

Importance

Changes 0
Metric Value
dl 11
loc 11
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 5
nc 2
nop 1
1
<?php
2
3
namespace MovingImage\Client\VMPro\Entity;
4
5
use MovingImage\Client\VMPro\Util\AccessorTrait;
6
7
/**
8
 * @method int getOffset()
9
 * @method ChannelsRequestParameters setOffset(int $offset)
10
 * @method int getLimit()
11
 * @method ChannelsRequestParameters setLimit(int $limit)
12
 * @method string getOrder()
13
 * @method string getOrderProperty()
14
 * @method ChannelsRequestParameters setOrderProperty(string $orderProperty)
15
 * @method string getSearchTerm()
16
 * @method ChannelsRequestParameters setSearchTerm(string $searchTerm)
17
 * @method string getSearchInField()
18
 * @method ChannelsRequestParameters setSearchInField(string $searchInField)
19
 */
20 View Code Duplication
class ChannelsRequestParameters
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...
21
{
22
    use AccessorTrait;
23
24
    /**
25
     * @param string $order
26
     *
27
     * @return ChannelsRequestParameters
28
     */
29
    public function setOrder($order)
30
    {
31
        $pool = ['asc', 'desc'];
32
33
        // Silently ignore wrong values
34
        if (in_array($order, $pool)) {
35
            $this->container['order'] = $order;
36
        }
37
38
        return $this;
39
    }
40
}
41