Kint_Object_Closure::getParams()   B
last analyzed

Complexity

Conditions 5
Paths 6

Size

Total Lines 22
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 5
eloc 12
nc 6
nop 0
dl 0
loc 22
rs 8.6737
c 0
b 0
f 0
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