Kint_Object_Closure   A
last analyzed

Complexity

Total Complexity 8

Size/Duplication

Total Lines 41
Duplicated Lines 7.32 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
dl 3
loc 41
rs 10
c 0
b 0
f 0
wmc 8
lcom 1
cbo 1

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getAccessPath() 3 6 2
A getSize() 0 3 1
B getParams() 0 22 5

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php
2
3
class Kint_Object_Closure extends Kint_Object_Instance
0 ignored issues
show
Coding Style introduced by
Kint_Object_Closure 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 $parameters = array();
6
    public $hints = array('object', 'callable', 'closure');
7
8
    private $paramcache = null;
9
10
    public function getAccessPath()
11
    {
12 View Code Duplication
        if ($this->access_path !== null) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
13
            return parent::getAccessPath().'('.$this->getParams().')';
14
        }
15
    }
16
17
    public function getSize()
18
    {
19
    }
20
21
    public function getParams()
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...
22
    {
23
        if ($this->paramcache !== null) {
24
            return $this->paramcache;
25
        }
26
27
        $out = array();
28
29
        foreach ($this->parameters as $p) {
30
            $type = $p->getType();
31
32
            $ref = $p->reference ? '&' : '';
33
34
            if ($type) {
35
                $out[] = $type.' '.$ref.$p->getName();
36
            } else {
37
                $out[] = $ref.$p->getName();
38
            }
39
        }
40
41
        return $this->paramcache = implode(', ', $out);
42
    }
43
}
44