Code Duplication    Length = 18-26 lines in 3 locations

core/exceptions/InvalidSessionDataException.php 1 location

@@ 12-29 (lines=18) @@
9
 * @package       Event Espresso
10
 * @author        Brent Christensen
11
 */
12
class InvalidSessionDataException extends \Exception
13
{
14
15
    /**
16
     * InvalidInterfaceException constructor.
17
     *
18
     * @param string     $message
19
     * @param int        $code
20
     * @param \Exception $previous
21
     */
22
    public function __construct($message = '', $code = 0, \Exception $previous = null)
23
    {
24
        if (empty($message)) {
25
            $message = esc_html__('The session data is either missing or invalid.', 'event_espresso');
26
        }
27
        parent::__construct($message, $code, $previous);
28
    }
29
}
30

core/services/assets/AssetRegistrationException.php 1 location

@@ 17-39 (lines=23) @@
14
 * @author  Brent Christensen
15
 * @since   $VID:$
16
 */
17
class AssetRegistrationException extends RuntimeException
18
{
19
    /**
20
     * @param                $script_handle
21
     * @param string         $message
22
     * @param int            $code
23
     * @param Exception|null $previous
24
     */
25
    public function __construct($script_handle, $message = '', $code = 0, Exception $previous = null)
26
    {
27
        if (empty($message)) {
28
            $message = sprintf(
29
                esc_html_x(
30
                    'The "%1$s" script could not be registered with WordPress core.',
31
                    'The "script-handle" script could not be registered with WordPress core.',
32
                    'event_espresso'
33
                ),
34
                $script_handle
35
            );
36
        }
37
        parent::__construct($message, $code, $previous);
38
    }
39
}

core/services/container/exceptions/ServiceNotFoundException.php 1 location

@@ 12-37 (lines=26) @@
9
 * @package       Event Espresso
10
 * @author        Brent Christensen
11
 */
12
class ServiceNotFoundException extends \RuntimeException
13
{
14
15
    /**
16
     * ServiceNotFoundException constructor
17
     *
18
     * @param string     $service_name the name of the requested service
19
     * @param string     $message
20
     * @param int        $code
21
     * @param \Exception $previous
22
     */
23
    public function __construct(
24
        $service_name,
25
        $message = '',
26
        $code = 0,
27
        \Exception $previous = null
28
    ) {
29
        if (empty($message)) {
30
            $message = sprintf(
31
                __('The requested service "%1$s" could not found be found in the CoffeeShop.', 'event_espresso'),
32
                $service_name
33
            );
34
        }
35
        parent::__construct($message, $code, $previous);
36
    }
37
}
38