1 | <?php |
||
13 | class Recorder extends Component{ |
||
14 | |||
15 | /** |
||
16 | * @var mixed |
||
17 | */ |
||
18 | protected $config = []; |
||
19 | |||
20 | /** |
||
21 | * The constructor |
||
22 | */ |
||
23 | 21 | public function __construct() { |
|
26 | |||
27 | /** |
||
28 | * Records an Exception to the database |
||
29 | * @param Exception $e The exception you want to record |
||
30 | * @return ExceptionModel|false |
||
31 | */ |
||
32 | 3 | public function record(Exception $e) |
|
62 | |||
63 | /** |
||
64 | * Checks the config to see if you can collect certain information |
||
65 | * @param string $type the config value you want to check |
||
66 | * @return boolean |
||
67 | */ |
||
68 | 3 | private function canCollect($type) { |
|
74 | |||
75 | /** |
||
76 | * @param string $key |
||
77 | */ |
||
78 | 3 | protected function collect($key,Exception $e = null){ |
|
94 | |||
95 | /** |
||
96 | * Gets the ID of the User that is logged in |
||
97 | * @return integer|null The ID of the User or Null if not logged in |
||
98 | */ |
||
99 | 3 | protected function getUserId() { |
|
107 | |||
108 | /** |
||
109 | * Gets the Method of the Request |
||
110 | * @return string|null Possible values are null or GET, POST, DELETE, PUT, etc... |
||
111 | */ |
||
112 | 3 | protected function getMethod() { |
|
120 | |||
121 | /** |
||
122 | * Gets the input data of the Request |
||
123 | * @return array|null The Input data or null |
||
124 | */ |
||
125 | 3 | protected function getData() { |
|
133 | |||
134 | /** |
||
135 | * Gets the URL of the Request |
||
136 | * @return string|null Returns a URL string or null |
||
137 | */ |
||
138 | 3 | protected function getUrl() { |
|
146 | |||
147 | /** |
||
148 | * Gets the status code of the Exception |
||
149 | * @param Exception $e The Exception to check |
||
150 | * @return string|integer The status code value |
||
151 | */ |
||
152 | 3 | protected function getStatusCode(Exception $e) { |
|
159 | } |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.