Passed
Push — develop ( 3db452...b7dcac )
by Nikolay
05:45
created

PbxExtensionUtils   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 6
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A isEnabled() 0 4 2
1
<?php
2
/**
3
 * Copyright (C) MIKO LLC - All Rights Reserved
4
 * Unauthorized copying of this file, via any medium is strictly prohibited
5
 * Proprietary and confidential
6
 * Written by Nikolay Beketov, 6 2020
7
 *
8
 */
9
10
namespace MikoPBX\Modules;
11
12
13
use MikoPBX\Common\Models\PbxExtensionModules;
14
15
class PbxExtensionUtils
16
{
17
    public static function isEnabled(string $moduleName):bool
18
    {
19
        $result        = PbxExtensionModules::findFirst("uniqid='{$moduleName}'");
20
        return ($result!==false && $result->disabled !== '1');
21
    }
22
}