Random::string deprecated?
Random::string isn't a static function, so you can't call it statically.

Well, you can (PHP is, erm, interesting like that), but it will throw a fatal error in future versions of the language, hence the warning now. To clarify, you're not being warned that Random::string itself is deprecated, just the method you're using to invoke it.

Get an instance instead and use that:

$random = new \Drupal\Component\Utility\Random();
$string = $random-&gt;string();