CacheException   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A getItemFromVariableArray() 0 4 1
1
<?php namespace CMPayments\Cache\Exceptions;
2
3
use CMPayments\Exception\BaseException;
4
5
/**
6
 * Class CacheException
7
 *
8
 * @package CMPayments\Cache\Exceptions
9
 * @Author  Boy Wijnmaalen <[email protected]>
10
 */
11
class CacheException extends BaseException
12
{
13
    const ERROR_CACHE_FILENAME_NOT_SET       = 1;
14
    const ERROR_CACHE_DIRECTORY_NOT_WRITABLE = 2;
15
16
    protected $messages = [
17
        self::ERROR_CACHE_FILENAME_NOT_SET       => 'The cache filename option \'%s\' is not set',
18
        self::ERROR_CACHE_DIRECTORY_NOT_WRITABLE => 'The cache directory \'%s\' is not writable'
19
    ];
20
21
    /**
22
     * prepend class name to clarify error origin
23
     *
24
     * @param int    $code
25
     * @param null   $default
26
     * @param string $msgArray
27
     *
28
     * @return string
29
     */
30
    public function getItemFromVariableArray($code, $default = null, $msgArray = 'messages')
31
    {
32
        return (new \ReflectionClass($this))->getShortName() . ': ' . parent::getItemFromVariableArray($code, $default, $msgArray);
33
    }
34
}