Access WP_REST_Server from within plugin namespace

WordPress (version 5.0) doesn’t use namespaces for it’s classes, so try to use the global one:

\WP_REST_Server

to avoid assuming it’s in your custom namespace.

One of the reason for this is that WordPress supports PHP 5.2.4+ that doesn’t support namespaces. The minimum is PHP 5.3.3+, if I remember correctly, to support it.

Later this year (2019) WordPress plans to bump the minimum required PHP version to 5.6 and then to 7 at the end of the year. So after that, WordPress namespaces could be possible, but I’m not aware of any such planned changes though 🙂