Width   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A run() 0 14 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 width of a given 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 Width implements StyleInterface
24
{
25
    
26
    public function run(ReportBuilder &$context, $coordString, $options) {
27
        
28
        switch ($options['type']) {
29
        case 'auto':
30
          $context->sheet()
31
          ->getColumnDimension($coordString)
32
          ->setAutoSize(true);
33
          break;
34
35
        default:
36
          throw new \Exception('Unrecognised style width option: '.$options['type']);
37
          break;
0 ignored issues
show
Unused Code introduced by
break; does not seem to be reachable.

This check looks for unreachable code. It uses sophisticated control flow analysis techniques to find statements which will never be executed.

Unreachable code is most often the result of return, die or exit statements that have been added for debug purposes.

function fx() {
    try {
        doSomething();
        return true;
    }
    catch (\Exception $e) {
        return false;
    }

    return false;
}

In the above example, the last return false will never be executed, because a return statement has already been met in every possible execution path.

Loading history...
38
      }
39
    }
40
}
41