1 | <?php |
||
12 | class Recorder { |
||
13 | |||
14 | /** |
||
15 | * @var mixed |
||
16 | */ |
||
17 | protected $config = []; |
||
18 | |||
19 | /** |
||
20 | * The constructor |
||
21 | */ |
||
22 | 21 | public function __construct() { |
|
25 | |||
26 | /** |
||
27 | * Records an Exception to the database |
||
28 | * @param Exception $e The exception you want to record |
||
29 | * @return ExceptionModel |
||
30 | */ |
||
31 | 3 | public function record(Exception $e) |
|
53 | |||
54 | /** |
||
55 | * Checks the config to see if you can collect certain information |
||
56 | * @param string $type the config value you want to check |
||
57 | * @return boolean |
||
58 | */ |
||
59 | 3 | private function canCollect($type) { |
|
65 | |||
66 | protected function collect($key,Exception $e = null){ |
||
93 | |||
94 | /** |
||
95 | * Gets the ID of the User that is logged in |
||
96 | * @return integer|null The ID of the User or Null if not logged in |
||
97 | */ |
||
98 | protected function getUserId() { |
||
106 | |||
107 | /** |
||
108 | * Gets the Method of the Request |
||
109 | * @return string|null Possible values are null or GET, POST, DELETE, PUT, etc... |
||
110 | */ |
||
111 | protected function getMethod() { |
||
119 | |||
120 | /** |
||
121 | * Gets the input data of the Request |
||
122 | * @return array|null The Input data or null |
||
123 | */ |
||
124 | protected function getData() { |
||
132 | |||
133 | /** |
||
134 | * Gets the URL of the Request |
||
135 | * @return string|null Returns a URL string or null |
||
136 | */ |
||
137 | protected function getUrl() { |
||
145 | |||
146 | /** |
||
147 | * Gets the status code of the Exception |
||
148 | * @param Exception $e The Exception to check |
||
149 | * @return string|integer The status code value |
||
150 | */ |
||
151 | protected function getStatusCode(Exception $e) { |
||
158 | } |
The break statement is not necessary if it is preceded for example by a return statement:
If you would like to keep this construct to be consistent with other case statements, you can safely mark this issue as a false-positive.