PdfException::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 6
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 5
crap 1
1
<?php
2
/**
3
 * General PDF exception.
4
 *
5
 * @copyright 2014-2019 Institute of Legal Medicine, Medical University of Innsbruck
6
 * @author Martin Pircher <[email protected]>
7
 * @author Andreas Erhard <[email protected]>
8
 * @license LGPL-3.0-only
9
 * @link http://www.gerichtsmedizin.at/
10
 *
11
 * @package pdftk
12
 */
13
14
namespace Gmi\Toolkit\Pdftk\Exception;
15
16
use Exception;
17
18
/**
19
 * This exception should be thrown if a PDF operation fails.
20
 */
21
class PdfException extends Exception
22
{
23
    /**
24
     * @var string
25
     */
26
    private $pdfError;
27
28
    /**
29
     * @var string
30
     */
31
    private $pdfOutput;
32
33
    /**
34
     * Constructor.
35
     *
36
     * @param string    $message
37
     * @param int       $code
38
     * @param Exception $previous
39
     * @param string    $pdfError
40
     * @param string    $pdfOutput
41
     */
42 22
    public function __construct($message, $code = 0, Exception $previous = null, $pdfError = null, $pdfOutput = null)
43
    {
44 22
        parent::__construct($message, $code, $previous);
45
46 22
        $this->pdfError = $pdfError;
47 22
        $this->pdfOutput = $pdfOutput;
48 22
    }
49
50
    /**
51
     * Returns the concrete error message of the underlying PDF library.
52
     */
53 4
    public function getPdfError()
54
    {
55 4
        return $this->pdfError;
56
    }
57
58
    /**
59
     * Returns the concrete output of the underlying PDF library.
60
     */
61 4
    public function getPdfOutput()
62
    {
63 4
        return $this->pdfOutput;
64
    }
65
}
66