Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 995cf4e

Browse files
Merge branch '2.7' into 2.8
* 2.7: Fix syntax in a test Normalize the way we check versions
2 parents 5f2acfd + 8dcf14a commit 995cf4e

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

src/Symfony/Bridge/Twig/Tests/Node/DumpNodeTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public function testOneVar()
8080
}
8181

8282
EOTXT;
83-
$expected = preg_replace('/%(.*?)%/', version_compare(PHP_VERSION, '5.4.0') >= 0 ? '(isset($context["$1"]) ? $context["$1"] : null)' : '$this->getContext($context, "$1")', $expected);
83+
$expected = preg_replace('/%(.*?)%/', PHP_VERSION_ID >= 50400 ? '(isset($context["$1"]) ? $context["$1"] : null)' : '$this->getContext($context, "$1")', $expected);
8484

8585
$this->assertSame($expected, $compiler->compile($node)->getSource());
8686
}
@@ -106,7 +106,7 @@ public function testMultiVars()
106106
}
107107

108108
EOTXT;
109-
$expected = preg_replace('/%(.*?)%/', version_compare(PHP_VERSION, '5.4.0') >= 0 ? '(isset($context["$1"]) ? $context["$1"] : null)' : '$this->getContext($context, "$1")', $expected);
109+
$expected = preg_replace('/%(.*?)%/', PHP_VERSION_ID >= 50400 ? '(isset($context["$1"]) ? $context["$1"] : null)' : '$this->getContext($context, "$1")', $expected);
110110

111111
$this->assertSame($expected, $compiler->compile($node)->getSource());
112112
}

src/Symfony/Bundle/FrameworkBundle/Command/ServerCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ abstract class ServerCommand extends ContainerAwareCommand
2323
*/
2424
public function isEnabled()
2525
{
26-
if (version_compare(phpversion(), '5.4.0', '<') || defined('HHVM_VERSION')) {
26+
if (PHP_VERSION_ID < 50400 || defined('HHVM_VERSION')) {
2727
return false;
2828
}
2929

src/Symfony/Component/Validator/Tests/Constraints/AbstractComparisonValidatorTestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ abstract class AbstractComparisonValidatorTestCase extends AbstractConstraintVal
3636
{
3737
protected static function addPhp5Dot5Comparisons(array $comparisons)
3838
{
39-
if (version_compare(PHP_VERSION, '5.5.0-dev', '<')) {
39+
if (PHP_VERSION_ID < 50500) {
4040
return $comparisons;
4141
}
4242

src/Symfony/Component/Validator/Tests/Constraints/IdenticalToValidatorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public function provideValidComparisons()
6969
array(null, 1),
7070
);
7171

72-
if (version_compare(PHP_VERSION, '>=', '5.5')) {
72+
if (PHP_VERSION_ID >= 50500) {
7373
$immutableDate = new \DateTimeImmutable('2000-01-01');
7474
$comparisons[] = array($immutableDate, $immutableDate);
7575
}

src/Symfony/Component/Validator/Tests/Constraints/RangeValidatorTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ public function getTenthToTwentiethMarch2014()
194194
array(new \DateTime('March 20, 2014')),
195195
);
196196

197-
if (version_compare(PHP_VERSION, '5.5.0-dev', '>=')) {
197+
if (PHP_VERSION_ID >= 50500) {
198198
$tests[] = array(new \DateTimeImmutable('March 10, 2014'));
199199
$tests[] = array(new \DateTimeImmutable('March 15, 2014'));
200200
$tests[] = array(new \DateTimeImmutable('March 20, 2014'));
@@ -216,7 +216,7 @@ public function getSoonerThanTenthMarch2014()
216216
array(new \DateTime('March 9, 2014'), 'Mar 9, 2014, 12:00 AM'),
217217
);
218218

219-
if (version_compare(PHP_VERSION, '5.5.0-dev', '>=')) {
219+
if (PHP_VERSION_ID >= 50500) {
220220
$tests[] = array(new \DateTimeImmutable('March 20, 2013'), 'Mar 20, 2013, 12:00 AM');
221221
$tests[] = array(new \DateTimeImmutable('March 9, 2014'), 'Mar 9, 2014, 12:00 AM');
222222
}
@@ -237,7 +237,7 @@ public function getLaterThanTwentiethMarch2014()
237237
array(new \DateTime('March 9, 2015'), 'Mar 9, 2015, 12:00 AM'),
238238
);
239239

240-
if (version_compare(PHP_VERSION, '5.5.0-dev', '>=')) {
240+
if (PHP_VERSION_ID >= 50500) {
241241
$tests[] = array(new \DateTimeImmutable('March 21, 2014'), 'Mar 21, 2014, 12:00 AM');
242242
$tests[] = array(new \DateTimeImmutable('March 9, 2015'), 'Mar 9, 2015, 12:00 AM');
243243
}

0 commit comments

Comments
 (0)