Completed
Push — master ( 76cf21...f8444d )
by Jeroen
01:30
created

VCardException   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A elementAlreadyExists() 0 4 1
A emptyURL() 0 4 1
A invalidImage() 0 4 1
A outputDirectoryNotExists() 0 4 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
 * @author Jeroen Desloovere <[email protected]>
16
 */
17
class VCardException extends \Exception
18
{
19
    public static function elementAlreadyExists($element)
20
    {
21
        return new self('You can only set "' . $element . '" once.');
22
    }
23
24
    public static function emptyURL()
25
    {
26
        return new self('Nothing returned from URL.');
27
    }
28
29
    public static function invalidImage()
30
    {
31
        return new self('Returned data is not an image.');
32
    }
33
34
    public static function outputDirectoryNotExists()
35
    {
36
        return new self('Output directory does not exist.');
37
    }
38
}
39