Completed
Push — master ( 77daf0...6ee4bd )
by Mauro
04:15
created

AdBag::addAd()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 3
cts 3
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
crap 1
1
<?php
2
/*
3
 * This file is part of the OLX Feed Generator package.
4
 *
5
 * (c) Zephia <[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
11
namespace Zephia\LaVozFeed\Entity;
12
13
/**
14
 * Class AdBag
15
 *
16
 * @package Zephia\LaVozFeed\Entity
17
 * @author  Mauro Moreno <[email protected]>
18
 */
19
class AdBag
20
{
21
    /**
22
     * @var array
23
     */
24
    private $ads = [];
25
26
    /**
27
     * Get Ads
28
     *
29
     * @return array
30
     */
31 3
    public function getAds()
32
    {
33 3
        return $this->ads;
34
    }
35
36
    /**
37
     * Set Ads
38
     *
39
     * @param array $ads
40
     *
41
     * @return $this
42
     */
43 1
    public function setAds(array $ads)
44
    {
45 1
        $this->ads = $ads;
46 1
        return $this;
47
    }
48
49
    /**
50
     * Add an ad
51
     *
52
     * @param Ad $ad
53
     *
54
     * @return $this
55
     */
56 1
    public function addAd(Ad $ad)
57
    {
58 1
        $this->ads[] = $ad;
59 1
        return $this;
60
    }
61
}