Completed
Pull Request — develop (#28)
by Michael
02:15
created

Field::setValue()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
ccs 0
cts 0
cp 0
rs 9.4286
cc 1
eloc 3
nc 1
nop 1
crap 2
1
<?php
2
3
namespace Crummy\Phlack\Message;
4
5
class Field extends Partial implements FieldInterface
6
{
7
    protected $required = ['title', 'value', 'short'];
8
9
    /**
10
     * Constructor.
11
     *
12
     * @param string $title
13
     * @param string $value
14
     * @param bool   $isShort
15
     */
16 8
    public function __construct($title = null, $value = null, $isShort = null)
17
    {
18 8
        parent::__construct(['title' => $title, 'value' => $value, 'short' => $isShort]);
19 8
    }
20
21
    /**
22
     * @return bool
23
     */
24 2
    public function isShort()
25
    {
26 2
        return isset($this['short']) ? $this['short'] : false;
27
    }
28
}
29