Completed
Push — 2.1 ( 3d3dcf...bebfa2 )
by Rafał
10:25 queued 20s
created

Component   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 0
loc 35
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getText() 0 4 1
getRole() 0 1 ?
A getLayout() 0 4 1
A getInlineTextStyles() 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
    /** @var array */
14
    protected $inlineTextStyles;
15
16
    public function __construct(string $text, string $layout = null, array $inlineTextStyles = [])
17
    {
18
        $this->text = $text;
19
        $this->layout = $layout;
20
        $this->inlineTextStyles = $inlineTextStyles;
21
    }
22
23
    public function getText(): string
24
    {
25
        return $this->text;
26
    }
27
28
    abstract public function getRole(): string;
29
30
    public function getLayout(): ?string
31
    {
32
        return $this->layout;
33
    }
34
35
    public function getInlineTextStyles(): array
36
    {
37
        return $this->inlineTextStyles;
38
    }
39
}
40