InvalidConfiguration   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 15
rs 10
c 0
b 0
f 0
wmc 3
lcom 1
cbo 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A modelIsNotValid() 0 4 1
A handlerNotFound() 0 3 1
A handlerTypeNotValid() 0 3 1
1
<?php
2
3
/**
4
 * Created by PhpStorm.
5
 * User: Lai Vu
6
 * Date: 10/24/2016
7
 * Time: 4:28 PM
8
 */
9
namespace LaiVu\ActivityLog\Exceptions;
10
11
use Exception;
12
use LaiVu\ActivityLog\Handlers\ActivityLogHandlerInterface;
13
use LaiVu\ActivityLog\Models\Activity;
14
15
class InvalidConfiguration extends Exception
16
{
17
    public static function modelIsNotValid($className)
18
    {
19
        return new static("The given model class `$className` does not extend `".Activity::class.'`');
20
    }
21
22
    public static function handlerNotFound($handlerName){
23
        return new static("The given handler `$handlerName` does not exist");
24
    }
25
26
    public static function handlerTypeNotValid($className){
27
        return new static("The given handler class `$className` does not extend `".ActivityLogHandlerInterface::class.'`');
28
    }
29
}