Kint_Object_Representation   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 33
rs 10
c 0
b 0
f 0
wmc 6
lcom 1
cbo 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 10 2
A getLabel() 0 8 3
A labelIsImplicit() 0 4 1
1
<?php
2
3
class Kint_Object_Representation
0 ignored issues
show
Coding Style introduced by
Kint_Object_Representation 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...
Coding Style introduced by
The property $implicit_label is not named in camelCase.

This check marks property names that have not been written in camelCase.

In camelCase names are written without any punctuation, the start of each new word being marked by a capital letter. Thus the name database connection string becomes databaseConnectionString.

Loading history...
4
{
5
    public $name;
6
    public $label;
7
    public $implicit_label = false;
0 ignored issues
show
Coding Style introduced by
$implicit_label 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...
8
    public $hints = array();
9
    public $contents = array();
10
11
    public function __construct($label, $name = null)
12
    {
13
        $this->label = $label;
14
15
        if ($name === null) {
16
            $name = preg_replace('/[^a-z0-9]+/', '_', strtolower($label));
0 ignored issues
show
Coding Style introduced by
Consider using a different name than the parameter $name. This often makes code more readable.
Loading history...
17
        }
18
19
        $this->name = $name;
20
    }
21
22
    public function getLabel()
23
    {
24
        if (is_array($this->contents) && count($this->contents) > 1) {
25
            return $this->label.' ('.count($this->contents).')';
26
        } else {
27
            return $this->label;
28
        }
29
    }
30
31
    public function labelIsImplicit()
0 ignored issues
show
Coding Style introduced by
function labelIsImplicit() does not seem to conform to the naming convention (^(?:is|has|should|may|supports)).

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...
32
    {
33
        return $this->implicit_label;
34
    }
35
}
36