IsPluginTrait::isPlugin()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 4
rs 10
ccs 3
cts 3
cp 1
cc 2
nc 2
nop 1
crap 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