VCardException   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 20
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A outputDirectoryNotExists() 0 3 1
A emptyURL() 0 3 1
A invalidImage() 0 3 1
A elementAlreadyExists() 0 3 1
1
<?php
2
3
namespace JeroenDesloovere\VCard;
4
5
/*
6
 * This file is part of the VCard PHP Class from Jeroen Desloovere.
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
/**
13
 * VCard Exception PHP Class.
14
 */
15
class VCardException extends \Exception
16
{
17
    public static function elementAlreadyExists($element)
18
    {
19
        return new self('You can only set "' . $element . '" once.');
20
    }
21
22
    public static function emptyURL()
23
    {
24
        return new self('Nothing returned from URL.');
25
    }
26
27
    public static function invalidImage()
28
    {
29
        return new self('Returned data is not an image.');
30
    }
31
32
    public static function outputDirectoryNotExists()
33
    {
34
        return new self('Output directory does not exist.');
35
    }
36
}
37