Completed
Push — master ( c82149...1de3af )
by Peter
04:41
created

SelfKeywordDecorator   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 4
dl 0
loc 12
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A decorate() 0 8 3
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: peter
5
 * Date: 01.02.18
6
 * Time: 15:28
7
 */
8
9
namespace Maslosoft\Addendum\Plugins\Matcher;
10
11
12
use Maslosoft\Addendum\Interfaces\Matcher\MatcherInterface;
13
use Maslosoft\Addendum\Interfaces\Plugins\Matcher\MatcherDecoratorInterface;
14
use Maslosoft\Addendum\Utilities\ReflectionHelper;
15
16
class SelfKeywordDecorator implements MatcherDecoratorInterface
17
{
18
19 19
	public function decorate(MatcherInterface $matcher, &$value)
20
	{
21 19
		if($value === 'self' || $value === 'static')
22
		{
23 5
			$reflection = ReflectionHelper::getReflectionClass($matcher->getPlugins()->reflection);
24 5
			$value = $reflection->name;
25
		}
26
	}
27
}