Kint_Renderer::__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
abstract class Kint_Renderer
0 ignored issues
show
Coding Style introduced by
Kint_Renderer 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
Kint_Renderer does not seem to conform to the naming convention (^Abstract|Factory$).

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
    protected $parameters;
6
7
    abstract public function render(Kint_Object $o);
0 ignored issues
show
Documentation introduced by
For interfaces and abstract methods it is generally a good practice to add a @return annotation even if it is just @return void or @return null, so that implementors know what to do in the overridden method.

For interface and abstract methods, it is impossible to infer the return type from the immediate code. In these cases, it is generally advisible to explicitly annotate these methods with a @return doc comment to communicate to implementors of these methods what they are expected to return.

Loading history...
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...
8
9
    /**
10
     * It's a constructor. It constructs.
11
     *
12
     * @param array $parameters Array with initial kint state information
13
     */
14
    public function __construct(array $parameters)
15
    {
16
        $this->parameters = $parameters;
17
    }
18
19
    /**
20
     * Returns the first compatible plugin available.
21
     *
22
     * @param array $plugins Array of hints to class strings
23
     * @param array $hints   Array of object hints
24
     *
25
     * @return array Array of hints to class strings filtered and sorted by object hints
26
     */
27
    public function matchPlugins(array $plugins, array $hints)
28
    {
29
        $out = array();
30
31
        foreach ($hints as $key) {
32
            if (isset($plugins[$key])) {
33
                $out[$key] = $plugins[$key];
34
            }
35
        }
36
37
        return $out;
38
    }
39
40
    public function parserPlugins(array $plugins)
41
    {
42
        return $plugins;
43
    }
44
45
    public function preRender()
46
    {
47
        return '';
48
    }
49
50
    public function postRender()
51
    {
52
        return '';
53
    }
54
}
55