Completed
Push — master ( 22c0d0...a51b30 )
by Lars
02:03
created

PakkelabelsException::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
c 1
b 1
f 0
dl 0
loc 8
rs 9.4285
cc 2
eloc 5
nc 2
nop 1
1
<?php
2
/**
3
 * Pakkelabels
4
 *
5
 * PHP version 5
6
 *
7
 * @category  Pakkelabels
8
 * @package   Pakkelabels
9
 * @author    Lars Olesen <[email protected]>
10
 * @copyright 2015 Lars Olesen
11
 * @license   MIT Open Source License https://opensource.org/licenses/MIT
12
 * @version   GIT: <git_id>
13
 * @link      http://github.com/discimport/pakkelabels-dk
14
 */
15
16
namespace Pakkelabels\Exception;
17
18
use Exception;
19
20
/**
21
 * Class Pakkelabels\Exception
22
 *
23
 * @category  Pakkelabels
24
 * @package   Pakkelabels
25
 * @author    Lars Olesen <[email protected]>
26
 * @copyright 2015 Lars Olesen
27
 * @license   http://opensource.org/licenses/bsd-license.php New BSD License
28
 * @link      http://github.com/discimport/pakkelabels-dk
29
 */
30
class PakkelabelsException extends \Exception
31
{
32
    /**
33
     * Construct the exception.
34
     *
35
     * @param string $message Message returned by API for error.
36
     */
37
    public function __construct($message = null)
38
    {
39
        if (is_array($message)) {
40
            parent::__construct(implode(', ', $message));
41
        } else {
42
            parent::__construct($message);
43
        }
44
    }
45
}
46