private function createThemeConfig(string
$name, string
$path): StorefrontPluginConfiguration
{ $pathname =
$path . \DIRECTORY_SEPARATOR . 'Resources/theme.json';
if (!
file_exists($pathname)) { throw new InvalidThemeBundleException($name);
} try { $fileContent =
file_get_contents($pathname);
if ($fileContent === false
) { throw new ThemeCompileException( $name,
'Unable to read theme.json'
);
} /** @var array<string, mixed> $data */
$data =
json_decode($fileContent, true
);
if (json_last_error() !== \JSON_ERROR_NONE
) { throw new ThemeCompileException( $name,
'Unable to parse theme.json. Message: ' .
json_last_error_msg() );