I'm going to write a complex application (backend) with a bunch of custom services. I know that there are different methods for accessing these services from controllers, forms, components and so on, but I want to ask you, which approach do you use, and why?
I.e. at the beginning of writing my code, I've used
$cookies = $this->di->get('cookies');
$cookie = $cookies->get('mycookie')->getValue();
But as I'm using cookies and other services from inside Volt like
{{ cookies.get('mycookie') == 'active' ? ... }}
To make it more solid, I decided to access services directly from inside controllers, forms and components like
$cookie = $this->cookies->get('mycookie')->getValue();
But I don't feel very comfortable with that, because it seems to me, that this way of accessing services involves magic getters. So, I always have to pay attention that I do not overload or overwrite a class variable which could be service name. So, how do you do it?