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

MagicConstantDecorator   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 85.71%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 17
ccs 6
cts 7
cp 0.8571
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A decorate() 0 13 3
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: peter
5
 * Date: 01.02.18
6
 * Time: 15:58
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
15
class MagicConstantDecorator implements MatcherDecoratorInterface
16
{
17
18 6
	public function decorate(MatcherInterface $matcher, &$value)
19
	{
20 6
		if(strpos($value, '::class') !== false)
21
		{
22 2
			$parts = explode('::', $value);
23 2
			if(count($parts) !== 2)
24
			{
25
				return;
26
			}
27
28 2
			$value = $parts[0];
29
		}
30
	}
31
}