ParameterReflection   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 1
dl 0
loc 27
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getDeclaringClass() 0 4 1
A getClass() 0 9 3
1
<?php
2
namespace Romm\ConfigurationObject\Legacy\Reflection;
3
4
/*
5
 * This file is part of the TYPO3 CMS project.
6
 *
7
 * It is free software; you can redistribute it and/or modify it under
8
 * the terms of the GNU General Public License, either version 2
9
 * of the License, or any later version.
10
 *
11
 * For the full copyright and license information, please read the
12
 * LICENSE.txt file that was distributed with this source code.
13
 *
14
 * The TYPO3 project - inspiring people to share!
15
 */
16
17
/**
18
 * Extended version of the ReflectionParameter
19
 */
20
class ParameterReflection extends \ReflectionParameter
21
{
22
    /**
23
     * Returns the declaring class
24
     *
25
     * @return ClassReflection The declaring class
26
     */
27
    public function getDeclaringClass()
28
    {
29
        return new ClassReflection(parent::getDeclaringClass()->getName());
0 ignored issues
show
Bug introduced by
Consider using parent::getDeclaringClass()->name. There is an issue with getName() and APC-enabled PHP versions.
Loading history...
30
    }
31
32
    /**
33
     * Returns the parameter class
34
     *
35
     * @return ClassReflection The parameter class
36
     */
37
    public function getClass()
38
    {
39
        try {
40
            $class = parent::getClass();
41
        } catch (\Exception $e) {
42
            return null;
43
        }
44
        return is_object($class) ? new ClassReflection($class->getName()) : null;
0 ignored issues
show
Bug introduced by
Consider using $class->name. There is an issue with getName() and APC-enabled PHP versions.
Loading history...
45
    }
46
}
47