Skip to content

Commit fd3dbb4

Browse files
committed
[#2338] Fixed installer replacement and PHPMD discovery.
1 parent b42e927 commit fd3dbb4

5 files changed

Lines changed: 3 additions & 29 deletions

File tree

.vortex/installer/src/Prompts/Handlers/Tools.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,8 +302,7 @@ public static function getToolDefinitions(string $filter = 'all'): array {
302302

303303
self::PHPMD => [
304304
'title' => 'PHP Mess Detector',
305-
'present' => fn(): mixed => File::contains($this->dstDir . '/composer.json', 'phpmd/phpmd') ||
306-
File::exists($this->dstDir . '/phpmd.xml'),
305+
'present' => fn(): mixed => File::contains($this->dstDir . '/composer.json', 'phpmd/phpmd'),
307306
'composer.json' => function (JsonManipulator $cj): void {
308307
$cj->removeSubNode('require-dev', 'phpmd/phpmd');
309308
},

.vortex/installer/src/Prompts/Handlers/Webroot.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,12 +144,13 @@ public function process(): void {
144144
sprintf('%s/', $webroot) => $v . '/',
145145
sprintf('%s\/', $webroot) => $v . '\/',
146146
sprintf(': %s', $webroot) => ': ' . $v,
147-
sprintf('=%s', $webroot) => '=' . $v,
148147
sprintf('!%s', $webroot) => '!' . $v,
149148
sprintf('/\/%s\//', $webroot) => '/' . $v . '/',
150149
sprintf('/\'\/%s\'/', $webroot) => "'/" . $v . "'",
151150
]);
152151

152+
File::replaceContentAsync(fn(string $content): string => preg_replace('/=' . preg_quote($webroot, '/') . '\b/', '=' . $v, $content) ?? $content);
153+
153154
rename($t . DIRECTORY_SEPARATOR . $webroot, $t . DIRECTORY_SEPARATOR . $v);
154155
}
155156

.vortex/installer/tests/Fixtures/handler_process/hosting_acquia/.env

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,6 @@
5555

5656
################################################################################
5757
# NOTIFICATIONS #
58-
@@ -202,7 +207,7 @@
59-
# An email address to send notifications from.
60-
#
61-
# Applies to email notifications.
62-
-VORTEX_NOTIFY_EMAIL_FROM=webmaster@star-wars.com
63-
+VORTEX_NOTIFY_EMAIL_FROM=docrootmaster@star-wars.com
64-
65-
# Email address(es) to send notifications to.
66-
#
6758
@@ -212,17 +217,3 @@
6859
# with optional names in the format "email|name".
6960
# Example: "to1@example.com|Jane Doe, to2@example.com|John Doe"

.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___acquia/.env

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,6 @@
5555

5656
################################################################################
5757
# NOTIFICATIONS #
58-
@@ -202,7 +207,7 @@
59-
# An email address to send notifications from.
60-
#
61-
# Applies to email notifications.
62-
-VORTEX_NOTIFY_EMAIL_FROM=webmaster@star-wars.com
63-
+VORTEX_NOTIFY_EMAIL_FROM=docrootmaster@star-wars.com
64-
65-
# Email address(es) to send notifications to.
66-
#
6758
@@ -212,17 +217,3 @@
6859
# with optional names in the format "email|name".
6960
# Example: "to1@example.com|Jane Doe, to2@example.com|John Doe"

.vortex/installer/tests/Unit/Handlers/ToolsHandlerDiscoveryTest.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -140,14 +140,6 @@ function (AbstractHandlerDiscoveryTestCase $test, Config $config): void {
140140
$test->stubComposerJsonDependencies(['phpmd/phpmd' => '*'], TRUE);
141141
},
142142
];
143-
yield 'tools - discovery - phpmd, alt' => [
144-
[],
145-
[Tools::id() => [Tools::PHPMD]] + $expected_installed,
146-
function (AbstractHandlerDiscoveryTestCase $test, Config $config): void {
147-
$test->stubVortexProject($config);
148-
File::dump(static::$sut . '/phpmd.xml');
149-
},
150-
];
151143
yield 'tools - discovery - phpunit' => [
152144
[],
153145
[Tools::id() => [Tools::PHPUNIT]] + $expected_installed,

0 commit comments

Comments
 (0)