2020 */
2121class ConfigOptionsList implements ConfigOptionsListInterface
2222{
23+ /**
24+ * Input key for the option
25+ */
26+ private const INPUT_KEY_SALT = 'id_salt ' ;
27+
28+ /**
29+ * Path to the value in the deployment config
30+ */
31+ private const CONFIG_PATH_SALT = 'cache/graphql/id_salt ' ;
32+
2333 /**
2434 * @var Random
2535 */
2636 private $ random ;
2737
2838 /**
29- * Deployment configuration
30- *
3139 * @var DeploymentConfig
3240 */
3341 private $ deploymentConfig ;
@@ -51,9 +59,9 @@ public function getOptions(): array
5159 {
5260 return [
5361 new TextConfigOption (
54- ConfigOptionsListConstants ::INPUT_KEY_SALT ,
62+ self ::INPUT_KEY_SALT ,
5563 TextConfigOption::FRONTEND_WIZARD_TEXT ,
56- ConfigOptionsListConstants ::CONFIG_PATH_SALT ,
64+ self ::CONFIG_PATH_SALT ,
5765 'GraphQl Salt '
5866 ),
5967 ];
@@ -65,17 +73,17 @@ public function getOptions(): array
6573 */
6674 public function createConfig (array $ data , DeploymentConfig $ deploymentConfig )
6775 {
68- $ currentIdSalt = $ this ->deploymentConfig ->get (ConfigOptionsListConstants ::CONFIG_PATH_SALT );
76+ $ currentIdSalt = $ this ->deploymentConfig ->get (self ::CONFIG_PATH_SALT );
6977
7078 $ configData = new ConfigData (ConfigFilePool::APP_ENV );
7179
7280 // Use given salt if set, else use current
73- $ id_salt = $ data [ConfigOptionsListConstants ::INPUT_KEY_SALT ] ?? $ currentIdSalt ;
81+ $ id_salt = $ data [self ::INPUT_KEY_SALT ] ?? $ currentIdSalt ;
7482
7583 // If there is no salt given or currently set, generate a new one
7684 $ id_salt = $ id_salt ?? $ this ->random ->getRandomString (ConfigOptionsListConstants::STORE_KEY_RANDOM_STRING_SIZE );
7785
78- $ configData ->set (ConfigOptionsListConstants ::CONFIG_PATH_SALT , $ id_salt );
86+ $ configData ->set (self ::CONFIG_PATH_SALT , $ id_salt );
7987
8088 return [$ configData ];
8189 }
0 commit comments