Access chained properties in DI configuration

24 days ago

Generous Backer | 734

Hello I use tharos/schematic for type-safe configuration objects.

That makes is possible to call for example $host = $config->ourApi->host.

Is it possible to access this kind of chained properties in config.neon?

When i use SomeService(@config::ourApi) it works well, however SomeService(@config::ourApi::host) is translated to $this->getService('config')->{'ourApi::host'} instead of $this->getService('config')->ourapi->host.

SomeService(@config::$ourApi::$host) doesn't work neither.