| Total Complexity | 11 |
| Total Lines | 39 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | class webhook {
|
||
| 13 | public static function init () {
|
||
| 20 | } |
||
| 21 | } |
||
| 22 | |||
| 23 | public static function telegramVerify() {
|
||
| 24 | if (settings::$telegram_verify) {
|
||
| 25 | if (!tools::isTelegram($_SERVER['REMOTE_ADDR'])) {
|
||
| 26 | logger::write('not authorized access denied. IP : '.$_SERVER['REMOTE_ADDR'],'error');
|
||
| 27 | BPT::close(); |
||
| 28 | } |
||
| 29 | } |
||
| 30 | } |
||
| 31 | |||
| 32 | public static function processUpdate(): update {
|
||
| 33 | $update = json_decode(file_get_contents("php://input"));
|
||
| 34 | if ($update) {
|
||
| 35 | return new update($update); |
||
| 36 | } |
||
| 37 | else {
|
||
| 38 | BPT::close(); |
||
|
|
|||
| 39 | } |
||
| 40 | } |
||
| 41 | |||
| 42 | public static function deleteOldLocks() {
|
||
| 51 | } |
||
| 52 | } |
||
| 53 | } |
For hinted functions/methods where all return statements with the correct type are only reachable via conditions, ?null? gets implicitly returned which may be incompatible with the hinted type. Let?s take a look at an example: