forked from concretecms/concretecms
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.php-cs-fixer.dist.php
More file actions
26 lines (19 loc) · 1003 Bytes
/
.php-cs-fixer.dist.php
File metadata and controls
26 lines (19 loc) · 1003 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php
declare(strict_types=1);
use Concrete\Core\Support\CodingStyle\PHPCSFixerConfigurator;
define('DIR_BASE', str_replace(DIRECTORY_SEPARATOR, '/', __DIR__));
require_once DIR_BASE . '/concrete/bootstrap/configure.php';
require_once DIR_BASE_CORE . '/src/Support/CodingStyle/autoload.php';
$minimumPHPVersion = $_ENV['C5_PHPCS_MIN_PHP_VERSION'] ?? '';
if (!is_string($minimumPHPVersion) || ($minimumPHPVersion = trim($minimumPHPVersion)) === '') {
$minimumPHPVersion = getenv('C5_PHPCS_MIN_PHP_VERSION');
if (!is_string($minimumPHPVersion) || ($minimumPHPVersion = trim($minimumPHPVersion)) === '') {
$minimumPHPVersion = '7.3';
}
}
$minimumPHPVersion = PHPCSFixerConfigurator::parseMinimumPHPVersionFormat($minimumPHPVersion);
echo "Fixing using rules for PHP {$minimumPHPVersion}\nYou can change it setting the C5_PHPCS_MIN_PHP_VERSION environment variable\n";
return (new PHPCSFixerConfigurator($minimumPHPVersion))
->setEnvironmentVariables()
->createConfig()
;