deploymentConfig = $deploymentConfig; } /** * Generates placeholder like CONFIG__DEFAULT__TEST__TEST_VALUE * * @inheritdoc * @since 100.1.2 */ public function generate($path, $scopeType = ScopeConfigInterface::SCOPE_TYPE_DEFAULT, $scopeCode = null) { $parts = $scopeType ? [$scopeType] : []; if ($scopeType !== ScopeConfigInterface::SCOPE_TYPE_DEFAULT && $scopeCode) { $parts[] = $scopeCode; } $parts[] = $path; $template = implode('__', $parts); $template = str_replace('/', '__', $template); $template = static::PREFIX . $template; $template = strtoupper($template); return $template; } /** * @inheritdoc * @since 100.1.2 */ public function restore($template) { $template = preg_replace('/^' . static::PREFIX . '/', '', $template); $template = str_replace('__', '/', $template); $template = strtolower($template); return $template; } /** * @inheritdoc * @since 100.1.2 */ public function isApplicable($placeholder) { return 1 === preg_match('/^' . static::PREFIX . '([a-zA-Z]+)([a-zA-Z0-9_])*$/', $placeholder); } }