Kint_Parser_DateTime   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
dl 0
loc 29
rs 10
c 0
b 0
f 0
wmc 6
lcom 0
cbo 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getTypes() 0 8 2
A getTriggers() 0 8 2
A parse() 0 8 2
1
<?php
2
3
class Kint_Parser_DateTime extends Kint_Parser_Plugin
0 ignored issues
show
Coding Style introduced by
Kint_Parser_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 function getTypes()
6
    {
7
        if (KINT_PHP53) {
8
            return array('object');
9
        } else {
10
            return array();
11
        }
12
    }
13
14
    public function getTriggers()
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
15
    {
16
        if (KINT_PHP53) {
17
            return Kint_Parser::TRIGGER_SUCCESS;
18
        } else {
19
            return Kint_Parser::TRIGGER_NONE;
20
        }
21
    }
22
23
    public function parse(&$var, Kint_Object &$o, $trigger)
0 ignored issues
show
Comprehensibility introduced by
Avoid variables with short names like $o. 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...
24
    {
25
        if (!$var instanceof DateTime) {
26
            return;
27
        }
28
29
        $o = $o->transplant(new Kint_Object_DateTime($var));
30
    }
31
}
32