Completed
Branch FET/11412/legacy-middleware (374f62)
by
unknown
61:08 queued 45:31
created

__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 20
Code Lines 14

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 14
c 1
b 0
f 0
nc 2
nop 4
dl 0
loc 20
rs 9.4285
1
<?php
2
3
namespace EventEspresso\core\services\request;
4
5
use EventEspresso\core\exceptions\InvalidDataTypeException;
6
use Exception;
7
8
defined('EVENT_ESPRESSO_VERSION') || exit;
9
10
11
12
/**
13
 * Class InvalidRequestStackMiddlewareException
14
 *
15
 * @package EventEspresso\core\services\request
16
 * @author  Brent Christensen
17
 * @since   $VID:$
18
 */
19
class InvalidRequestStackMiddlewareException extends InvalidDataTypeException
20
{
21
22
    /**
23
     * @param  mixed     $middleware_app_class
24
     * @param  string    $message
25
     * @param int        $code
26
     * @param Exception $previous
27
     */
28
    public function __construct($middleware_app_class, $message = '', $code = 0, Exception $previous = null)
29
    {
30
        if (empty($message)) {
31
            $message = sprintf(
32
                esc_html__(
33
                    'The supplied Request Stack Middleware class "%1$s" is invalid or could no be found.',
34
                    'event_espresso'
35
                ),
36
                $middleware_app_class
37
            );
38
        }
39
        parent::__construct(
40
            '$middleware_app_class',
41
            $middleware_app_class,
42
            'EventEspresso\core\services\request\middleware\Middleware',
43
            $message,
44
            $code,
45
            $previous
46
        );
47
    }
48
}
49