Completed
Push — 2.1 ( 63ded9...b14dac )
by Paweł
23s queued 11s
created

Component   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 26
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getText() 0 4 1
getRole() 0 1 ?
A getLayout() 0 4 1
1
<?php
2
3
namespace SWP\Bundle\CoreBundle\AppleNews\Component;
4
5
abstract class Component implements ComponentInterface
6
{
7
    /** @var string */
8
    protected $text;
9
10
    /** @var string|null */
11
    protected $layout;
12
13
    public function __construct(string $text, string $layout = null)
14
    {
15
        $this->text = $text;
16
        $this->layout = $layout;
17
    }
18
19
    public function getText(): string
20
    {
21
        return $this->text;
22
    }
23
24
    abstract public function getRole(): string;
25
26
    public function getLayout(): ?string
27
    {
28
        return $this->layout;
29
    }
30
}
31