Completed
Branch BUG/reg-status-change-recursio... (2db0c9)
by
unknown
20:03 queued 10:32
created

CollectionLoaderException::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 14

Duplication

Lines 14
Ratio 100 %

Importance

Changes 0
Metric Value
cc 2
nc 2
nop 3
dl 14
loc 14
rs 9.7998
c 0
b 0
f 0
1
<?php
2
3
namespace EventEspresso\core\services\collections;
4
5
use Exception;
6
use RuntimeException;
7
8
/**
9
 * Class CollectionLoaderException
10
 * Thrown when some other exception occurs during the creation and/or loading of a Collection
11
 *
12
 * @package EventEspresso\core\services\collections
13
 * @author  Brent Christensen
14
 * @since   4.9.62.p
15
 */
16 View Code Duplication
class CollectionLoaderException extends RuntimeException
17
{
18
19
    /**
20
     * DuplicateCollectionIdentifierException constructor.
21
     *
22
     * @param Exception $previous
23
     * @param string    $message
24
     * @param int       $code
25
     */
26
    public function __construct(Exception $previous, $message = '', $code = 0)
27
    {
28
        if (empty($message)) {
29
            $message = sprintf(
30
                __(
31
                    'The following error occurred during the creation and/or loading of this collection: %1$s %2$s',
32
                    'event_espresso'
33
                ),
34
                '<br />',
35
                $previous->getMessage()
36
            );
37
        }
38
        parent::__construct($message, $code, $previous);
39
    }
40
}
41