| Conditions | 19 |
| Paths | 19 |
| Total Lines | 47 |
| Code Lines | 29 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
| 1 | <?php |
||
| 84 | private static function processHandler(): void { |
||
| 85 | if (settings::$handler) { |
||
| 86 | if (isset(BPT::$update->message)) { |
||
| 87 | if (self::handlerExist('message')) { |
||
| 88 | BPT::$handler->message(BPT::$update->message); |
||
| 89 | } |
||
| 90 | } |
||
| 91 | elseif (isset(BPT::$update->edited_message)) { |
||
| 92 | if (self::handlerExist('edited_message')) { |
||
| 93 | BPT::$handler->edited_message(BPT::$update->edited_message); |
||
| 94 | } |
||
| 95 | } |
||
| 96 | elseif (isset(BPT::$update->channel_post)) { |
||
| 97 | if (self::handlerExist('channel_post')) { |
||
| 98 | BPT::$handler->channel_post(BPT::$update->channel_post); |
||
| 99 | } |
||
| 100 | } |
||
| 101 | elseif (isset(BPT::$update->edited_channel_post)) { |
||
| 102 | if (self::handlerExist('edited_channel_post')) { |
||
| 103 | BPT::$handler->edited_channel_post(BPT::$update->edited_channel_post); |
||
| 104 | } |
||
| 105 | } |
||
| 106 | elseif (isset(BPT::$update->inline_query)) { |
||
| 107 | if (self::handlerExist('inline_query')) { |
||
| 108 | BPT::$handler->inline_query(BPT::$update->inline_query); |
||
| 109 | } |
||
| 110 | } |
||
| 111 | elseif (isset(BPT::$update->callback_query)) { |
||
| 112 | if (self::handlerExist('callback_query')) { |
||
| 113 | BPT::$handler->callback_query(BPT::$update->callback_query); |
||
| 114 | } |
||
| 115 | } |
||
| 116 | elseif (isset(BPT::$update->my_chat_member)) { |
||
| 117 | if (self::handlerExist('my_chat_member')) { |
||
| 118 | BPT::$handler->my_chat_member(BPT::$update->my_chat_member); |
||
| 119 | } |
||
| 120 | } |
||
| 121 | elseif (isset(BPT::$update->chat_member)) { |
||
| 122 | if (self::handlerExist('chat_member')) { |
||
| 123 | BPT::$handler->chat_member(BPT::$update->chat_member); |
||
| 124 | } |
||
| 125 | } |
||
| 126 | elseif (self::handlerExist('something_else')) { |
||
| 127 | BPT::$handler->something_else(BPT::$update); |
||
| 128 | } |
||
| 129 | else { |
||
| 130 | logger::write('Update received but handlers does not set',loggerTypes::WARNING); |
||
| 131 | } |
||
| 141 | } |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths