Completed
Pull Request — master (#2230)
by
unknown
04:09 queued 01:51
created

IdFilter::setIds()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 0
cts 5
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 2
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the FOSRestBundle package.
7
 *
8
 * (c) FriendsOfSymfony <http://friendsofsymfony.github.com/>
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace FOS\RestBundle\Filter;
15
16
/**
17
 * @author Bartek Chmura <[email protected]>
18
 */
19
final class IdFilter implements FilterInterface
20
{
21
    /**
22
     * @var string[]
23
     */
24
    private $ids;
25
26
    /**
27
     * @var string
28
     */
29
    private $id;
30
31
    /**
32
     * @return string[]
33
     */
34
    public function getIds(): iterable
35
    {
36
        return $this->ids;
37
    }
38
39
    public function isIdsSet(): bool
40
    {
41
        return isset($this->ids);
42
    }
43
44
    public function setIds(array $ids): self
45
    {
46
        $this->ids = $ids;
47
48
        return $this;
49
    }
50
51
    public function getId(): string
52
    {
53
        return $this->id;
54
    }
55
56
    public function isIdSet(): bool
57
    {
58
        return isset($this->id);
59
    }
60
61
    public function setId(string $id): self
62
    {
63
        $this->id = $id;
64
65
        return $this;
66
    }
67
}
68