IsPluginTrait   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 3
c 1
b 0
f 0
dl 0
loc 10
rs 10
ccs 3
cts 3
cp 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A isPlugin() 0 4 2
1
<?php
2
3
4
namespace Deployee\Components\Plugins\Locator;
5
6
use Deployee\Components\Plugins\PluginInterface;
7
8
trait IsPluginTrait
9
{
10
    /**
11
     * @param string $expectedClass
12
     * @return bool
13
     */
14 2
    private function isPlugin(string $expectedClass): bool
15
    {
16 2
        return class_exists($expectedClass)
17 2
            && in_array(PluginInterface::class, class_implements($expectedClass), false);
18
    }
19
}
20