Completed
Branch FET-9795-new-interfaces (ea072c)
by
unknown
118:13 queued 96:20
created

InvalidCommandHandlerException::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 6

Duplication

Lines 9
Ratio 100 %

Importance

Changes 0
Metric Value
cc 2
eloc 6
c 0
b 0
f 0
nc 2
nop 4
dl 9
loc 9
rs 9.6666
1
<?php
2
namespace EventEspresso\core\services\commands;
3
4
if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) {
5
	exit( 'No direct script access allowed' );
6
}
7
8
9
10
/**
11
 * Class InvalidCommandHandlerException
12
 * thrown when the Command Handler for a Command could not be resolved
13
 *
14
 * @package       Event Espresso
15
 * @author        Brent Christensen
16
 * @since         4.9.0
17
 */
18 View Code Duplication
class InvalidCommandHandlerException 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...
19
{
20
21
	/**
22
	 * @access public
23
	 * @param  string     $command_name
24
	 * @param  string     $message
25
	 * @param  int        $code
26
	 * @param  \Exception $previous
27
	 */
28
	public function __construct( $command_name, $message = '', $code = 0, \Exception $previous = null ) {
29
		if ( empty( $message ) ) {
30
			$message = sprintf(
31
				__( 'The supplied Command Handler "%1$s" does not have a valid name. It should be in the following format: "{CommandName}Handler" ', 'event_espresso' ),
32
				$command_name
33
			);
34
		}
35
		parent::__construct( $message, $code, $previous );
36
	}
37
38
}
39
// End of file InvalidCommandHandlerException.php
40
// Location: core/services/commands/InvalidCommandHandlerException.php