Example for Debian:
Enable sury/php repository
apt-get install php8.1-{cgi,cli,fpm,pdo,gd,mbstring,mysqlnd,opcache,curl,xml,zip}
Install additional PHP packages
apt-get install php8.1-{cgi,cli,fpm,pdo,gd,mbstring,mysqlnd,opcache,curl,xml,zip}
StringTranslationTrait allow to get t() and formatPlural() methods
Example:
use Drupal\Core\StringTranslation\StringTranslationTrait;
use Drupal\Core\StringTranslation\TranslationInterface;
class MyClass {
Static references to the current class like self:: or __CLASS__ are resolved using the class in which the function belongs, as in where it was defined.