Kint_Object_Resource::transplant()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 1
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
class Kint_Object_Resource extends Kint_Object
0 ignored issues
show
Coding Style introduced by
Kint_Object_Resource 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 $resource_type 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 $resource_type = null;
0 ignored issues
show
Coding Style introduced by
$resource_type 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...
6
7
    public function getType()
8
    {
9
        if ($this->resource_type) {
10
            return $this->resource_type.' resource';
11
        } else {
12
            return 'resource';
13
        }
14
    }
15
16
    public function transplant(Kint_Object $new)
17
    {
18
        $new = parent::transplant($new);
0 ignored issues
show
Coding Style introduced by
Consider using a different name than the parameter $new. This often makes code more readable.
Loading history...
19
        $new->resource_type = $this->resource_type;
0 ignored issues
show
Bug introduced by
The property resource_type does not seem to exist in Kint_Object.

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
20
21
        return $new;
22
    }
23
}
24