DefaultResolver   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 2
dl 0
loc 10
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A resolveByDefault() 0 2 2
1
<?php
2
3
namespace evelikto\di\resolver;
4
5
/** Resolves parameter to its default value if present */
6
trait DefaultResolver
7
{
8
    /**
9
     * Resolves parameter to its default value.
10
     *
11
     * @param   \ReflectionParameter  $param  Parameter to be resolved.
12
     * @return  mixed|null                    Parameter default value or null if no default.
13
     */
14
    protected function resolveByDefault(\ReflectionParameter $param) {
15
        return $param->isDefaultValueAvailable() ? $param->getDefaultValue() : null;
16
    }
17
}