Completed
Push — master ( f560d6...a27d66 )
by WEBEWEB
01:15
created

AbstractAlert   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 84
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 8
lcom 0
cbo 0
dl 0
loc 84
rs 10
c 0
b 0
f 0

8 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getContent() 0 3 1
A getDismissible() 0 3 1
A getPrefix() 0 3 1
A getType() 0 3 1
A setContent() 0 4 1
A setDismissible() 0 4 1
A setType() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of the bootstrap-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\BootstrapBundle\Alert;
13
14
/**
15
 * Abstract alert.
16
 *
17
 * @author webeweb <https://github.com/webeweb/>
18
 * @package WBW\Bundle\BootstrapBundle\Alert
19
 * @abstract
20
 */
21
abstract class AbstractAlert implements AlertInterface {
22
23
    /**
24
     * Content.
25
     *
26
     * @var string
27
     */
28
    private $content;
29
30
    /**
31
     * Dismissible.
32
     *
33
     * @var bool
34
     */
35
    private $dismissible;
36
37
    /**
38
     * Type.
39
     *
40
     * @var string
41
     */
42
    private $type;
43
44
    /**
45
     * Constructor.
46
     *
47
     * @param string type.
48
     */
49
    protected function __construct($type) {
50
        $this->setType($type);
51
    }
52
53
    /**
54
     * {@inheritDoc}
55
     */
56
    public function getContent() {
57
        return $this->content;
58
    }
59
60
    /**
61
     * {@inheritDoc}
62
     */
63
    public function getDismissible() {
64
        return $this->dismissible;
65
    }
66
67
    /**
68
     * {@inheritDoc}
69
     */
70
    public function getPrefix() {
71
        return "alert-";
72
    }
73
74
    /**
75
     * {@inheritDoc}
76
     */
77
    public function getType() {
78
        return $this->type;
79
    }
80
81
    /**
82
     * {@inheritDoc}
83
     */
84
    public function setContent($content) {
85
        $this->content = $content;
86
        return $this;
87
    }
88
89
    /**
90
     * {@inheritDoc}
91
     */
92
    public function setDismissible($dismissible) {
93
        $this->dismissible = $dismissible;
94
        return $this;
95
    }
96
97
    /**
98
     * {@inheritDoc}
99
     */
100
    public function setType($type) {
101
        $this->type = $type;
102
        return $this;
103
    }
104
}
105