ModuleException   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 35
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A invalid() 0 3 1
A notFound() 0 3 1
A getModuleClass() 0 3 1
A __construct() 0 5 1
1
<?php namespace BuildR\ClassLoader\Exception;
2
3
use \Exception;
4
5
/**
6
 * Collection of exceptions when thrown in various class.
7
 *
8
 * BuildR PHP Framework
9
 *
10
 * @author Zoltán Borsos <[email protected]>
11
 * @package ClassLoader
12
 * @subpackage Exception
13
 *
14
 * @copyright    Copyright 2015, Zoltán Borsos.
15
 * @license      https://github.com/Zolli/BuildR/blob/master/LICENSE.md
16
 * @link         https://github.com/Zolli/BuildR
17
 *
18
 * @codeCoverageIgnore
19
 */
20
class ModuleException extends Exception {
21
22
    const MESSAGE_MODULE_INVALID = "Invalid Class Loader Module!";
23
24
    const MESSAGE_MODULE_NOT_FOUND = "The given class loader not found!";
25
26
    /**
27
     * @type string
28
     */
29
    private $moduleClass;
30
31
    public static function invalid($moduleClass) {
32
        return new self(self::MESSAGE_MODULE_INVALID, $moduleClass);
33
    }
34
35
    public static function notFound($moduleClass) {
36
        return new self(self::MESSAGE_MODULE_INVALID, $moduleClass);
37
    }
38
39
    public function __construct($message = "", $className, $code = 0, Exception $previous = NULL) {
40
        $this->moduleClass = $className;
41
42
        parent::__construct($message, $code, $previous);
43
    }
44
45
    /**
46
     * Return the module FQCN.
47
     *
48
     * @return string
49
     */
50
    public function getModuleClass() {
51
        return $this->moduleClass;
52
    }
53
54
}
55