/**
* Get the service for a given key
*
* @param string $key The service key to look up
*
* @return string|object
*
* @since 4.0.0
*/
public function getService(string $key)
{
if (!$this->hasService($key)) {
throw new \InvalidArgumentException("The '{$key}' service key is not registered.");
}
return $this->serviceMap[$key];
}