Failed Conditions
Pull Request — develop_3.0 (#434)
by Adrien
03:02
created

CellManager   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
c 0
b 0
f 0
lcom 1
cbo 2
dl 0
loc 28
ccs 0
cts 9
cp 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A applyStyle() 0 5 1
1
<?php
2
3
namespace Box\Spout\Writer\Common\Manager;
4
5
use Box\Spout\Writer\Common\Entity\Cell;
6
use Box\Spout\Writer\Common\Entity\Style\Style;
7
use Box\Spout\Writer\Common\Manager\Style\StyleMerger;
8
9
class CellManager
10
{
11
    /**
12
     * @var StyleMerger
13
     */
14
    protected $styleMerger;
15
16
    /**
17
     * @param StyleMerger $styleMerger
18
     */
19
    public function __construct(StyleMerger $styleMerger)
20
    {
21
        $this->styleMerger = $styleMerger;
22
    }
23
24
    /**
25
     * Merges a Style into a cell's Style.
26
     *
27
     * @param Cell $cell
28
     * @param Style $style
29
     * @return $this
30
     */
31
    public function applyStyle(Cell $cell, Style $style)
32
    {
33
        $mergedStyle = $this->styleMerger->merge($cell->getStyle(), $style);
34
        $cell->setStyle($mergedStyle);
35
    }
36
}
37