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

TCheckExt::checkExtension()   A

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
ccs 3
cts 3
cp 1
rs 10
cc 2
nc 2
nop 1
crap 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