1 | <?php |
||
7 | class VideoPress_XMLRPC { |
||
8 | |||
9 | /** |
||
10 | * @var VideoPress_XMLRPC |
||
11 | **/ |
||
12 | private static $instance = null; |
||
13 | |||
14 | /** |
||
15 | * The current user object. |
||
16 | * |
||
17 | * @var WP_User |
||
18 | */ |
||
19 | private $current_user; |
||
20 | |||
21 | /** |
||
22 | * Private VideoPress_XMLRPC constructor. |
||
23 | * |
||
24 | * Use the VideoPress_XMLRPC::init() method to get an instance. |
||
25 | */ |
||
26 | private function __construct() { |
||
29 | |||
30 | /** |
||
31 | * Initialize the VideoPress_XMLRPC and get back a singleton instance. |
||
32 | * |
||
33 | * @return VideoPress_XMLRPC |
||
34 | */ |
||
35 | public static function init() { |
||
42 | |||
43 | /** |
||
44 | * Adds additional methods the WordPress xmlrpc API for handling VideoPress specific features |
||
45 | * |
||
46 | * @param array $methods The Jetpack API methods. |
||
47 | * @param array $core_methods The WordPress Core API methods (ignored). |
||
48 | * @param WP_User $user The user object the API request is signed by. |
||
49 | * |
||
50 | * @return array |
||
51 | */ |
||
52 | public function xmlrpc_methods( $methods, $core_methods, $user ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable |
||
63 | |||
64 | /** |
||
65 | * This is used by the WPCOM VideoPress uploader in order to create a media item with |
||
66 | * specific meta data about an uploaded file. After this, the transcoding session will |
||
67 | * update the meta information via the update_videopress_media_item() method. |
||
68 | * |
||
69 | * Note: This method technically handles the creation of multiple media objects, though |
||
70 | * in practice this is never done. |
||
71 | * |
||
72 | * @param array $media |
||
73 | * @return array |
||
74 | */ |
||
75 | public function create_media_item( $media ) { |
||
98 | |||
99 | /** |
||
100 | * @param array $request |
||
101 | * |
||
102 | * @return bool |
||
103 | */ |
||
104 | public function update_videopress_media_item( $request ) { |
||
155 | |||
156 | /** |
||
157 | * @param array $request |
||
158 | * @return bool |
||
159 | */ |
||
160 | public function update_poster_image( $request ) { |
||
188 | |||
189 | /** |
||
190 | * Check if the XML-RPC request is signed by a user token, and authenticate the user in WordPress. |
||
191 | * |
||
192 | * @return bool |
||
193 | */ |
||
194 | private function authenticate_user() { |
||
203 | } |
||
204 |
This error could be the result of:
1. Missing dependencies
PHP Analyzer uses your
composer.json
file (if available) to determine the dependencies of your project and to determine all the available classes and functions. It expects thecomposer.json
to be in the root folder of your repository.Are you sure this class is defined by one of your dependencies, or did you maybe not list a dependency in either the
require
orrequire-dev
section?2. Missing use statement
PHP does not complain about undefined classes in
ìnstanceof
checks. For example, the following PHP code will work perfectly fine:If you have not tested against this specific condition, such errors might go unnoticed.