Passed
Push — master ( 6f3564...5d9325 )
by Curtis
12:40
created

Date   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 18
rs 10
c 0
b 0
f 0
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A read() 0 9 3
1
<?php
2
3
namespace FamilyTree365\LaravelGedcom\Utils\Exporter;
4
5
use Carbon\Carbon;
0 ignored issues
show
Bug introduced by
The type Carbon\Carbon was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
7
class Date
8
{
9
    /**
10
     * Array of persons ID
11
     * key - old GEDCOM ID
12
     * value - new autoincrement ID.
13
     *
14
     * @var string
15
     */
16
    public static function read($conn, $input_date)
0 ignored issues
show
Unused Code introduced by
The parameter $conn is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

16
    public static function read(/** @scrutinizer ignore-unused */ $conn, $input_date)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
17
    {
18
        if (is_object($input_date)) {
19
            if (method_exists($input_date, 'getDate')) {
20
                return $input_date->getDate();
21
            }
22
        } else {
23
            // $input_date = Carbon::parse($input_date)->timestamp;
24
            return "$input_date";
25
        }
26
    }
27
}
28