Passed
Push — master ( f4c27e...d54548 )
by Alexander
03:11
created

Handler::setException()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 1
b 0
f 0
1
<?php 
2
3
/**
4
 * Lenevor Framework
5
 *
6
 * LICENSE
7
 *
8
 * This source file is subject to the new BSD license that is bundled
9
 * with this package in the file license.md.
10
 * It is also available through the world-wide-web at this URL:
11
 * https://lenevor.com/license
12
 * If you did not receive a copy of the license and are unable to
13
 * obtain it through the world-wide-web, please send an email
14
 * to [email protected] so we can send you a copy immediately.
15
 *
16
 * @package     Lenevor
17
 * @subpackage  Base
18
 * @link        https://lenevor.com
19
 * @copyright   Copyright (c) 2019 - 2023 Alexander Campo <[email protected]>
20
 * @license     https://opensource.org/licenses/BSD-3-Clause New BSD license or see https://lenevor.com/license or see /license.md
21
 */
22
23
namespace Syscodes\Components\Debug\Handlers;
24
25
use Syscodes\Components\Contracts\Debug\MainHandler;
26
use Syscodes\Components\Debug\FrameHandler\Supervisor;
27
28
/**
29
 * Abstract implementation of a Handler.
30
 */
31
abstract class Handler implements MainHandler
32
{ 
33
    /**
34
     * The Handler has handled the Throwable in some way, and wishes to skip any other Handler.
35
     * Execution will continue.
36
     */
37
    const LAST_HANDLER = 0x20;
38
39
    /**
40
     * The Handler has handled the Throwable in some way, and wishes to quit/stop execution.
41
     */
42
    const QUIT = 0x30;
43
44
    /**
45
     * Get debug.
46
     * 
47
     * @var \Syscodes\Components\Contracts\Debug\Handler $debug
48
     */
49
    protected $debug;
50
    
51
    /**
52
     * Get exception.
53
     * 
54
     * @var \Throwable $exception
55
     */
56
    protected $exception;
57
    
58
    /**
59
     * Get supervisor.
60
     * 
61
     * @var string $supervisor
62
     */
63
    protected $supervisor;
64
65
    /**
66
     * Gets Debug class with you interface.
67
     * 
68
     * @return \Syscodes\Components\Contracts\Debug\Handler  Interface
69
     */
70
    public function getDebug()
71
    {
72
        return $this->debug;
73
    }
74
75
    /**
76
     * Sets debug.
77
     * 
78
     * @param  \Syscodes\Components\Contracts\Debug\Handler  $debug
79
     * 
80
     * @return void
81
     */
82
    public function setDebug($debug): void
83
    {
84
        $this->debug = $debug;
85
    }
86
    
87
    /**
88
     * Gets exception already specified.
89
     * 
90
     * @return \Throwable
91
     */
92
    public function getException()
93
    {
94
        return $this->exception;
95
    }
96
97
    /**
98
     * Sets exception.
99
     * 
100
     * @param  \Throwable  $exception
101
     * 
102
     * @return void
103
     */
104
    public function setException($exception): void
105
    {
106
        $this->exception = $exception;
107
    }
108
    
109
    /**
110
     * Gets supervisor already specified.
111
     * 
112
     * @return \Syscodes\Components\Debug\FrameHandler\Supervisor
113
     */
114
    public function getSupervisor()
115
    {
116
        return $this->supervisor;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->supervisor returns the type string which is incompatible with the documented return type Syscodes\Components\Debug\FrameHandler\Supervisor.
Loading history...
117
    }
118
119
    /**
120
     * Sets supervisor.
121
     * 
122
     * @param  \Syscodes\Components\Debug\FrameHandler\Supervisor  $supervisor
123
     * 
124
     * @return void
125
     */
126
    public function setSupervisor(Supervisor $supervisor): void
127
    {
128
        $this->supervisor = $supervisor;
0 ignored issues
show
Documentation Bug introduced by
It seems like $supervisor of type Syscodes\Components\Debug\FrameHandler\Supervisor is incompatible with the declared type string of property $supervisor.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
129
    }
130
}