Completed
Push — master ( 38c8ff...90c00b )
by Dmitry
01:29
created

ExitException::getName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace PHPKitchen\Platform\Exception\Runtime\App;
4
5
use Throwable;
6
7
/**
8
 * Represents thrown to terminate application.
9
 *
10
 * Such exception should be caught only by low-level classes that would handle {@link statusCode} and
11
 * terminate the application.
12
 *
13
 * @package PHPKitchen\Platform\Exception\Runtime\App
14
 * @author Dmitry Kolodko <[email protected]>
15
 */
16
class ExitException extends \Exception {
17
    /**
18
     * @var int the exit status code
19
     */
20
    public $statusCode;
21
22
    /**
23
     * Constructor.
24
     *
25
     * @param int $status the exit status code
26
     * @param string $message error message
0 ignored issues
show
Documentation introduced by
Should the type for parameter $message not be string|null?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
27
     * @param int $code error code
28
     * @param Throwable $previous The previous exception used for the exception chaining.
0 ignored issues
show
Documentation introduced by
Should the type for parameter $previous not be null|Throwable?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
29
     */
30
    public function __construct($status = 0, $message = null, $code = 0, Throwable $previous = null) {
31
        $this->statusCode = $status;
32
        parent::__construct($message, $code, $previous);
33
    }
34
35
    public function getName() {
36
        return 'App Exit';
37
    }
38
}