private function encode(stdClass $jsonData, $path)
{
try {
return $this->jsonEncoder->encode($jsonData);
} catch (EncodingFailedException $e) {
throw new InvalidConfigException(sprintf('The configuration in %s could not be encoded: %s', $path, $e->getMessage()), 0, $e);
}
}