Automattic /
jetpack
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
| 1 | <?php |
||
| 2 | |||
| 3 | class Jetpack_JSON_API_Jetpack_Log_Endpoint extends Jetpack_JSON_API_Endpoint { |
||
| 4 | // GET /sites/%s/jetpack-log |
||
| 5 | protected $needed_capabilities = 'manage_options'; |
||
| 6 | |||
| 7 | protected function result() { |
||
| 8 | $args = $this->input(); |
||
| 9 | $event = ( isset( $args['event'] ) && is_string( $args['event'] ) ) ? $code : false; |
||
| 10 | $num = ( isset( $args['num'] ) ) ? intval( $num ) : false; |
||
| 11 | |||
| 12 | return array( |
||
| 13 | 'log' => Jetpack::get_log( $event, $num ) |
||
|
0 ignored issues
–
show
|
|||
| 14 | ); |
||
| 15 | } |
||
| 16 | } |
||
| 17 |
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.