Bg   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 16
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A run() 0 12 2
1
<?php
2
3
/*
4
 * This file is part of the ReportBundle package
5
 * 
6
 * (c) symball <http://simonball.me>
7
 * 
8
 * For the full copyright and license information, please view the LICENSE file 
9
 * that was distributed with this source code.
10
 */
11
12
/**
13
 * Set the background color for a cell
14
 *
15
 * @author Simon Ball <simonball at simonball dot me>
16
 */
17
18
namespace Symball\ReportBundle\Styles;
19
20
use Symball\ReportBundle\Service\ReportBuilder;
21
use Symball\ReportBundle\Interfaces\StyleInterface;
22
23
class Bg implements StyleInterface
24
{
25
26
    public function run(ReportBuilder &$context, $coordString, $options)
27
    {
28
        if (!isset($options['color'])) {
29
            $options['color'] = $options['default_bg_color'];
30
        }
31
32
        $context->sheet()
33
        ->getStyle($coordString)
34
        ->applyFromArray(['fill' => array(
35
            'type' => \PHPExcel_Style_Fill::FILL_SOLID,
36
        'color' => array('rgb' => $options['color']), )]);
37
    }
38
}
39