Picture::setPicture()   A
last analyzed

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 La Voz 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
use Zephia\LaVozFeed\Exception\LogicException;
13
14
/**
15
 * Class Picture
16
 *
17
 * @package Zephia\LaVozFeed\Entity
18
 * @author  Mauro Moreno <[email protected]>
19
 */
20
class Picture extends Entity
21
{
22
    /**
23
     * @var string
24
     */
25
    private $picture = '';
26
27
    /**
28
     * Get Picture
29
     *
30
     * @return string
31
     */
32 4
    public function getPicture()
33
    {
34 4
        if (empty($this->picture)) {
35 1
            throw new LogicException(
36 1
                sprintf(self::ERROR_MISSING_ATTRIBUTE_FORMAT, 'picture')
37 1
            );
38
        }
39 3
        return $this->picture;
40
    }
41
42
    /**
43
     * Set Picture
44
     *
45
     * @param string $picture
46
     *
47
     * @return Picture
48
     */
49 3
    public function setPicture($picture)
50
    {
51 3
        $this->picture = $picture;
52 3
        return $this;
53
    }
54
}
55