Skip to content

Commit bdc5d3a

Browse files
committed
Fix composer setup
1 parent 19b1c50 commit bdc5d3a

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

setup-config.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -233,20 +233,19 @@ function getVersion($cmd)
233233
echo "Setup process is successfully completed!\n";
234234

235235
// PHP > 8.4 Fixing
236-
if (version_compare($phpVersion, '8.4.0', '>=')) {
237-
echo "\033[0;36mℹ️ PHP >= 8.4 detected, installing php-cs-fixer...\033[0m\n";
236+
if (PHP_VERSION_ID >= 80400) {
237+
echo "\033[0;36m PHP >= 8.4 detected, installing php-cs-fixer...\033[0m\n";
238238

239-
// Installing php-cs-fixer as a dev dependency
240239
passthru("composer require --dev friendsofphp/php-cs-fixer");
241240

242-
// Run the fixer
243241
if (stripos(PHP_OS, 'WIN') === 0) {
244242
passthru(".\\vendor\\bin\\php-cs-fixer fix");
245243
} else {
246244
passthru("./vendor/bin/php-cs-fixer fix");
247245
}
246+
248247
echo "\033[0;32m Code style fixed with php-cs-fixer.\033[0m\n";
249248
} else {
250-
echo "\033[0;33m PHP version < 8.4 → skipping php-cs-fixer installation.\033[0m\n";
249+
echo "\033[0;33m PHP version < 8.4 → skipping php-cs-fixer.\033[0m\n";
251250
}
252251

0 commit comments

Comments
 (0)