8000 added support for Symfony 5 · symfony/requirements-checker@8e134f6 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8e134f6

Browse files
committed
added support for Symfony 5
1 parent 8e0ed9b commit 8e134f6

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/SymfonyRequirements.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ class SymfonyRequirements extends RequirementCollection
2222
{
2323
const REQUIRED_PHP_VERSION_3x = '5.5.9';
2424
const REQUIRED_PHP_VERSION_4x = '7.1.3';
25+
const REQUIRED_PHP_VERSION_5x = '7.2.5';
2526

2627
public function __construct($rootDir, $symfonyVersion = null)
2728
{
@@ -32,7 +33,14 @@ public function __construct($rootDir, $symfonyVersion = null)
3233
$rootDir = $this->getComposerRootDir($rootDir);
3334
$options = $this->readComposer($rootDir);
3435

35-
$phpVersion = $symfonyVersion && version_compare($symfonyVersion, '4.0.0', '>=') ? self::REQUIRED_PHP_VERSION_4x : self::REQUIRED_PHP_VERSION_3x;
36+
$phpVersion = self::REQUIRED_PHP_VERSION_3x;
37+
if (null !== $symfonyVersion) {
38+
if (version_compare($symfonyVersion, '5.0.0', '>=')) {
39+
$phpVersion = self::REQUIRED_PHP_VERSION_5x;
40+
} elseif (version_compare($symfonyVersion, '4.0.0', '>=')) {
41+
$phpVersion = self::REQUIRED_PHP_VERSION_4x;
42+
}
43+
}
3644

3745
$this->addRequirement(
3846
version_compare($installedPhpVersion, $phpVersion, '>='),

0 commit comments

Comments
 (0)
0