Passed
Push — master ( eec14a...4028c5 )
by Alexander
02:26
created

PlaceholderTrait   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 33
ccs 5
cts 5
cp 1
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getPlaceholder() 0 3 1
A setPlaceholder() 0 5 1
1
<?php
2
namespace Maknz\Slack;
3
4
use Maknz\Slack\BlockElement\Text;
5
6
trait PlaceholderTrait
7
{
8
    /**
9
     * Select placeholder.
10
     *
11
     * @var \Maknz\Slack\BlockElement\Text
12
     */
13
    protected $placeholder;
14
15
    /**
16
     * Get the placeholder.
17
     *
18
     * @return \Maknz\Slack\BlockElement\Text
19
     */
20 41
    public function getPlaceholder()
21
    {
22 41
        return $this->placeholder;
23
    }
24
25
    /**
26
     * Set the placeholder.
27
     *
28
     * @param mixed $placeholder
29
     *
30
     * @return $this
31
     *
32
     * @throws \InvalidArgumentException
33
     */
34 47
    public function setPlaceholder($placeholder)
35
    {
36 47
        $this->placeholder = Text::create($placeholder, Text::TYPE_PLAIN);
37
38 47
        return $this;
39
    }
40
}
41