8000 [3.0] Removed some old hacks · symfony/symfony@56ffc6d · GitHub
[go: up one dir, main page]

Skip to content

Commit 56ffc6d

Browse files
GrahamCampbellnicolas-grekas
authored andcommitted
[3.0] Removed some old hacks
1 parent d282545 commit 56ffc6d

File tree

62 files changed

+108
-756
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+108
-756
lines changed

README.md

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,13 @@ README
44
What is Symfony?
55
-----------------
66

7-
Symfony is a PHP 5.3 full-stack web framework. It is written with speed and
7+
Symfony is a PHP full-stack web framework. It is written with speed and
88
flexibility in mind. It allows developers to build better and easy to maintain
99
websites with PHP.
1010

1111
Symfony can be used to develop all kind of websites, from your personal blog
1212
to high traffic ones like Dailymotion or Yahoo! Answers.
1313

14-
Requirements
15-
------------
16-
17-
Symfony is only supported on PHP 5.3.3 and up.
18-
19-
Be warned that PHP versions before 5.3.8 are known to be buggy and might not
20-
work for you:
21-
22-
* before PHP 5.3.4, if you get "Notice: Trying to get property of
23-
non-object", you've hit a known PHP bug (see
24-
https://bugs.php.net/bug.php?id=52083 and
25-
https://bugs.php.net/bug.php?id=50027);
26-
27-
* before PHP 5.3.8, if you get an error involving annotations, you've hit a
28-
known PHP bug (see https://bugs.php.net/bug.php?id=55156).
29-
30-
* PHP 5.3.16 has a major bug in the Reflection subsystem and is not suitable to
31-
run Symfony (https://bugs.php.net/bug.php?id=62715)
32-
3314
Installation
3415
------------
3516

autoload.php.dist

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php
22

3-
if (PHP_VERSION_ID >= 50400 && gc_enabled()) {
4-
// Disabling Zend Garbage Collection to prevent segfaults with PHP5.4+
5-
// https://bugs.php.net/bug.php?id=53976
3+
// Disabling Zend Garbage Collection to prevent segfaults
4+
// https://bugs.php.net/bug.php?id=53976
5+
if (gc_enabled()) {
66
gc_disable();
77
}
88

src/Symfony/Bridge/Twig/Extension/CodeExtension.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -174,11 +174,7 @@ public function formatFile($file, $line, $text = null)
174174
$text = "$text at line $line";
175175

176176
if (false !== $link = $this->getFileLink($file, $line)) {
177-
if (PHP_VERSION_ID >= 50400) {
178-
$flags = ENT_QUOTES | ENT_SUBSTITUTE;
179-
} else {
180-
$flags = ENT_QUOTES;
181-
}
177+
$flags = ENT_QUOTES | ENT_SUBSTITUTE;
182178

183179
return sprintf('<a href="%s" title="Click to open this file" class="file_link">%s</a>', htmlspecialchars($link, $flags, $this->charset), $text);
184180
}

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,6 @@ public function testCompile()
6666

6767
protected function getVariableGetter($name)
6868
{
69-
if (PHP_VERSION_ID >= 50400) {
70-
return sprintf('(isset($context["%s"]) ? $context["%s"] : null)', $name, $name);
71-
}
72-
73-
return sprintf('$this->getContext($context, "%s")', $name);
69+
return sprintf('(isset($context["%s"]) ? $context["%s"] : null)', $name, $name);
7470
}
7571
}

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -263,10 +263,6 @@ public function testCompileLabelWithLabelThatEvaluatesToNullAndAttributes()
263263

264264
protected function getVariableGetter($name)
265265
{
266-
if (PHP_VERSION_ID >= 50400) {
267-
return sprintf('(isset($context["%s"]) ? $context["%s"] : null)', $name, $name);
268-
}
269-
270-
return sprintf('$this->getContext($context, "%s")', $name);
266+
return sprintf('(isset($context["%s"]) ? $context["%s"] : null)', $name, $name);
271267
}
272268
}

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

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,11 @@ public function testCompileStrict()
3838
}
3939
protected function getVariableGetterWithoutStrictCheck($name)
4040
{
41-
if (PHP_VERSION_ID >= 50400) {
42-
return sprintf('(isset($context["%s"]) ? $context["%s"] : null)', $name, $name);
43-
}
44-
45-
return sprintf('$this->getContext($context, "%s", true)', $name);
41+
return sprintf('(isset($context["%s"]) ? $context["%s"] : null)', $name, $name);
4642
}
4743

4844
protected function getVariableGetterWithStrictCheck($name)
4945
{
50-
if (PHP_VERSION_ID >= 50400) {
51-
return sprintf('(isset($context["%s"]) ? $context["%s"] : $this->getContext($context, "%s"))', $name, $name, $name);
52-
}
53-
54-
return sprintf('$this->getContext($context, "%s")', $name);
46+
return sprintf('(isset($context["%s"]) ? $context["%s"] : $this->getContext($context, "%s"))', $name, $name, $name);
5547
}
5648
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class ServerRunCommand extends ContainerAwareCommand
3030
*/
3131
public function isEnabled()
3232
{
33-
if (PHP_VERSION_ID < 50400 || defined('HHVM_VERSION')) {
33+
if (defined('HHVM_VERSION')) {
3434
return false;
3535
}
3636

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -498,14 +498,7 @@ private function addValidationSection(ArrayNodeDefinition $rootNode)
498498
->validate()
499499
->ifTrue(function ($v) { return !isset($v['validation']['api']) || 'auto' === $v['validation']['api']; })
500500
->then(function ($v) {
501-
// This condition is duplicated in ValidatorBuilder. This
502-
// duplication is necessary in order to know the desired
503-
// API version already during container configuration
504-
// (to adjust service classes etc.)
505-
// See https://github.com/symfony/symfony/issues/11580
506-
$v['validation']['api'] = PHP_VERSION_ID < 50309
507-
? '2.4'
508-
: '2.5-bc';
501+
$v['validation']['api'] = '2.5-bc';
509502

510503
return $v;
511504
})

src/Symfony/Bundle/FrameworkBundle/Templating/Helper/CodeHelper.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -166,11 +166,7 @@ public function formatFile($file, $line, $text = null)
166166
}
167167

168168
if (false !== $link = $this->getFileLink($file, $line)) {
169-
if (PHP_VERSION_ID >= 50400) {
170-
$flags = ENT_QUOTES | ENT_SUBSTITUTE;
171-
} else {
172-
$flags = ENT_QUOTES;
173-
}
169+
$flags = ENT_QUOTES | ENT_SUBSTITUTE;
174170

175171
return sprintf('<a href="%s" title="Click to open this file" class="file_link">%s</a>', htmlspecialchars($link, $flags, $this->charset), $text);
176172
}

src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/JsonDescriptorTest.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,6 @@
1515

1616
class JsonDescriptorTest extends AbstractDescriptorTest
1717
{
18-
protected function setUp()
19-
{
20-
if (PHP_VERSION_ID < 50400) {
21-
$this->markTestSkipped('Test skipped on PHP 5.3 as JSON_PRETTY_PRINT does not exist.');
22-
}
23-
}
24-
2518
protected function getDescriptor()
2619
{
2720
return new JsonDescriptor();

0 commit comments

Comments
 (0)
0