Completed
Push — master ( f3c5a2...9c66df )
by WEBEWEB
02:13
created

AbstractToast::getContent()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of the core-bundle package.
5
 *
6
 * (c) 2019 WEBEWEB
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace WBW\Bundle\CoreBundle\Toast;
13
14
/**
15
 * Abstract toast.
16
 *
17
 * @author webeweb <https://github.com/webeweb/>
18
 * @package WBW\Bundle\CoreBundle\Toast
19
 * @abstract
20
 */
21
abstract class AbstractToast implements ToastInterface {
22
23
    /**
24
     * Content.
25
     *
26
     * @var string
27
     */
28
    private $content;
29
30
    /**
31
     * Type.
32
     *
33
     * @var string
34
     */
35
    private $type;
36
37
    /**
38
     * Constructor.
39
     *
40
     * @param string $type The type.
41
     * @param string $content The content.
42
     */
43
    protected function __construct($type, $content) {
44
        $this->setContent($content);
45
        $this->setType($type);
46
    }
47
48
    /**
49
     * {@inheritDoc}
50
     */
51
    public function getContent() {
52
        return $this->content;
53
    }
54
55
    /**
56
     * {@inheritDoc}
57
     */
58
    public function getType() {
59
        return $this->type;
60
    }
61
62
    /**
63
     * Set the content.
64
     *
65
     * @param string $content The content.
66
     * @return ToastInterface Returns this toast.
67
     */
68
    protected function setContent($content) {
69
        $this->content = $content;
70
        return $this;
71
    }
72
73
    /**
74
     * Set the type.
75
     *
76
     * @param string $type The type.
77
     * @return ToastInterface Returns this toast.
78
     */
79
    protected function setType($type) {
80
        $this->type = $type;
81
        return $this;
82
    }
83
}
84