Completed
Branch FET-9795-new-interfaces (ea072c)
by
unknown
127:10 queued 107:02
created

EntityConstructionException::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 12
Code Lines 8

Duplication

Lines 12
Ratio 100 %

Importance

Changes 0
Metric Value
cc 2
eloc 8
nc 2
nop 4
dl 12
loc 12
rs 9.4285
c 0
b 0
f 0
1
<?php
2
namespace EventEspresso\core\exceptions;
3
4
5
if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) {
6
	exit( 'No direct script access allowed' );
7
}
8
9
10
11
/**
12
 * Class EntityConstructionException
13
 * Description
14
 *
15
 * @package       Event Espresso
16
 * @author        Brent Christensen
17
 * @since         $VID:$
18
 */
19 View Code Duplication
class EntityConstructionException extends \DomainException {
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
20
21
22
	/**
23
	 * EntityConstructionException constructor
24
	 *
25
	 * @param string $entity_class class name of the entity being constructed
26
	 * @param string $message
27
	 * @param int $code
28
	 * @param \Exception $previous
29
	 */
30
	public function __construct( $entity_class, $message = '', $code = 0, \Exception $previous = null ) {
31
		if ( empty( $message ) ) {
32
			$message = sprintf(
33
				__(
34
					'The "%1$s" entity could not be instantiated for an unknown reason',
35
					'event_espresso'
36
				),
37
				$entity_class
38
			);
39
		}
40
		parent::__construct( $message, $code, $previous );
41
	}
42
43
}
44
// End of file EntityConstructionException.php
45
// Location: /EntityConstructionException.php