Completed
Push — master ( 778938...5ff82c )
by Markus
11:26
created

ExcelGenericDateItemConverter   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 85.71%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
c 1
b 0
f 0
lcom 0
cbo 2
dl 0
loc 19
ccs 6
cts 7
cp 0.8571
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A convert() 0 14 4
1
<?php
2
namespace Mathielen\DataImport\ValueConverter;
3
4
class ExcelGenericDateItemConverter extends GenericDateItemConverter
5
{
6
7 2
    public function convert($input)
8
    {
9 2
        if (!$input) {
10 1
            return null;
11
        }
12
13 1
        if (is_numeric($input) && $input < 100000) { //Date may be 42338 (=> 30.11.2015
0 ignored issues
show
Unused Code Comprehensibility introduced by
39% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
14 1
            $date = \PHPExcel_Shared_Date::ExcelToPHPObject($input);
15
16 1
            return $this->formatOutput($date);
17
        }
18
19
        return parent::convert($input);
20
    }
21
22
}
23