Skip to content

Commit 424c01f

Browse files
committed
refactor: remove parameters configuration handling from ScriptHandler
1 parent 0c80945 commit 424c01f

2 files changed

Lines changed: 3 additions & 30 deletions

File tree

composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@
129129
"PhpList\\Core\\Composer\\ScriptHandler::createBundleConfiguration",
130130
"PhpList\\Core\\Composer\\ScriptHandler::createRoutesConfiguration",
131131
"PhpList\\Core\\Composer\\ScriptHandler::createDotenvConfiguration",
132-
"PhpList\\Core\\Composer\\ScriptHandler::createParametersConfiguration",
133132
"php bin/console cache:clear",
134133
"php bin/console cache:warmup"
135134
],

src/Composer/ScriptHandler.php

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,11 @@ class ScriptHandler
3333
*/
3434
const ROUTES_CONFIGURATION_FILE = '/config/routing_modules.yml';
3535

36-
/**
37-
* @var string
38-
*/
39-
const PARAMETERS_CONFIGURATION_FILE = '/config/parameters.yml';
40-
4136
/**
4237
* @var string
4338
*/
4439
const GENERAL_CONFIGURATION_FILE = '/config/config_modules.yml';
4540

46-
/**
47-
* @var string
48-
*/
49-
const PARAMETERS_TEMPLATE_FILE = '/config/parameters.yml.dist';
50-
5141
/**
5242
* @var string
5343
*/
@@ -274,24 +264,6 @@ public static function clearAllCaches():void
274264
$fileSystem->remove(self::getApplicationRoot() . '/var/cache');
275265
}
276266

277-
/**
278-
* Creates config/parameters.yml (the parameters configuration file).
279-
*
280-
* @return void
281-
*/
282-
public static function createParametersConfiguration(): void
283-
{
284-
$configurationFilePath = self::getApplicationRoot() . self::PARAMETERS_CONFIGURATION_FILE;
285-
if (file_exists($configurationFilePath)) {
286-
return;
287-
}
288-
289-
$templateFilePath = __DIR__ . '/../..' . static::PARAMETERS_TEMPLATE_FILE;
290-
$configuration = file_get_contents($templateFilePath);
291-
292-
self::createAndWriteFile($configurationFilePath, $configuration);
293-
}
294-
295267
/**
296268
* Creates the .env file (the environment variables consumed by the parameters configuration)
297269
* by copying it from .env.dist, generating a fresh app secret in the process.
@@ -301,11 +273,13 @@ public static function createParametersConfiguration(): void
301273
public static function createDotenvConfiguration(): void
302274
{
303275
$dotenvFilePath = self::getApplicationRoot() . self::DOTENV_FILE;
276+
$templateFilePath = __DIR__ . '/../..' . static::DOTENV_TEMPLATE_FILE;
277+
304278
if (file_exists($dotenvFilePath)) {
279+
copy($dotenvFilePath, $templateFilePath);
305280
return;
306281
}
307282

308-
$templateFilePath = __DIR__ . '/../..' . static::DOTENV_TEMPLATE_FILE;
309283
$template = file_get_contents($templateFilePath);
310284

311285
$secret = bin2hex(random_bytes(20));

0 commit comments

Comments
 (0)