How can I access the container from a static class method?

I have class with only static method

<?phpThis text will be hidden
use Carbon\Carbon;
use Respect\Validation\Validator as r;

class ClientService {

	private static $container;

	public static function init($container) {
		self::$container = $container;

	public static function getContainer() {
		return self::$container;

	public static function create($params) {

		$data['user'] = [
			'email'    => $params['email'],
			'password' => password_hash($params['password'], PASSWORD_DEFAULT)
		$data['client'] = [
			'firstname'  => $params['firstname'],
			'secondname' => $params['secondname'],
			'thirdname'  => $params['thirdname']

		$client = Client::create($data['client']);
		$data['user']['password'] = password_hash($data['user']['password'], PASSWORD_DEFAULT);
		$user = User::create($data['user']);

		return $client;

	public static function isValid($request) {
		// to do form validation

I implemented the transfer of the container by writing to the static variable of the class through calling the static method, I do not want to initiate this class anywhere through the constructor, I want to work with it as with a static one.

Is it implemented correctly or is there a more correct way?

The use of Singletons should be a very careful and calculated step because they can become a bottleneck during development and debugging.

Read more: Why is Singleton considered an anti-pattern?

In Slim 4 you should better use the container (PHP-DI) and dependency injection instead.