Test Failed
Push — master ( 41e89b...cfe199 )
by ANTHONIUS
04:45 queued 12s
created

CoreException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A moduleShouldImplementModuleInterface() 0 5 1
A modulesFileNotFound() 0 5 1
1
<?php
2
3
/*
4
 * This file is part of the EOffice project.
5
 *
6
 * (c) Anthonius Munthi <https://itstoni.com>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
declare(strict_types=1);
13
14
namespace EOffice\Core\Exception;
15
16
use EOffice\Contracts\Support\ModuleInterface;
17
18
class CoreException extends \Exception
19
{
20
    public static function modulesFileNotFound(string $path): self
21
    {
22
        return new self(sprintf(
23
            'Modules config "%s" file not exists.',
24
            $path
25
        ));
26
    }
27
28
    public static function moduleShouldImplementModuleInterface(string $class): self
29
    {
30
        return new self(sprintf(
31
            'Module class "%s" should implement "'.ModuleInterface::class.'"',
32
            $class
33
        ));
34
    }
35
}
36