Passed
Push — master ( 486cfe...a23967 )
by Petr
02:57
created

TCheckExt   A

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
ccs 3
cts 3
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A checkExtension() 0 4 2
1
<?php
2
3
namespace kalanis\kw_mapper\Storage\Shared;
4
5
6
use kalanis\kw_mapper\MapperException;
7
8
9
/**
10
 * trait TCheckExt
11
 * @package kalanis\kw_mapper\Storage\Shared
12
 */
13
trait TCheckExt
14
{
15
    /**
16
     * @param string $name
17
     * @throws MapperException
18
     */
19 4
    public function checkExtension(string $name): void
20
    {
21 4
        if (!extension_loaded($name)) {
22 1
            throw new MapperException(sprintf('Extension *%s* is not present!', $name));
23
        }
24
    }
25
}
26