Kint_Object_DateTime::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
class Kint_Object_DateTime extends Kint_Object_Instance
0 ignored issues
show
Coding Style introduced by
Kint_Object_DateTime does not seem to conform to the naming convention (^[A-Z][a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
4
{
5
    public $dt;
0 ignored issues
show
Comprehensibility introduced by
Avoid variables with short names like $dt. Configured minimum length is 3.

Short variable names may make your code harder to understand. Variable names should be self-descriptive. This check looks for variable names who are shorter than a configured minimum.

Loading history...
6
7
    public $hints = array('object', 'datetime');
8
9
    public function __construct(DateTime $dt)
0 ignored issues
show
Comprehensibility introduced by
Avoid variables with short names like $dt. Configured minimum length is 3.

Short variable names may make your code harder to understand. Variable names should be self-descriptive. This check looks for variable names who are shorter than a configured minimum.

Loading history...
10
    {
11
        $this->dt = clone $dt;
12
    }
13
14
    public function getValueShort()
15
    {
16
        $stamp = $this->dt->format('Y-m-d H:i:s');
17
        if (KINT_PHP522 && intval($micro = $this->dt->format('u'))) {
18
            $stamp .= '.'.$micro;
19
        }
20
        $stamp .= $this->dt->format('P T');
21
22
        return $stamp;
23
    }
24
}
25