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

ExcelGenericDateItemConverter::convert()   A

Complexity

Conditions 4
Paths 3

Size

Total Lines 14
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 4.0466

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 14
ccs 6
cts 7
cp 0.8571
rs 9.2
cc 4
eloc 7
nc 3
nop 1
crap 4.0466
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