Kint_Object_DateTime   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 22
rs 10
c 0
b 0
f 0
wmc 4
lcom 1
cbo 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getValueShort() 0 10 3
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