ProductFamilyExcelBuilder   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A getWorksheetName() 0 8 2
1
<?php
2
3
namespace Pim\Bundle\ExcelConnectorBundle\Excel\Builder;
4
5
use PHPExcel_Shared_String;
6
7
/**
8
 * Excel builder for products, with one tab per family
9
 *
10
 * @author    Antoine Guigan <[email protected]>
11
 * @copyright 2013 Akeneo SAS (http://www.akeneo.com)
12
 * @license   http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
13
 */
14
class ProductFamilyExcelBuilder extends AbstractExcelBuilder
15
{
16
    /**
17
     * {@inheritdoc}
18
     */
19
    protected function getWorksheetName(array $data)
20
    {
21
        $worksheetName = $data['family'];
22
        if (PHPExcel_Shared_String::CountCharacters($worksheetName) > 31) {
23
            $worksheetName = PHPExcel_Shared_String::Substring($worksheetName, 0, 31);
24
        }
25
        return $worksheetName;
26
    }
27
}
28