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

ExitException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 23
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getName() 0 3 1
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
}