Skip to content

Commit

Permalink
minor #22914 Remove some more PHP < 7.1.3 code (ogizanagi)
Browse files Browse the repository at this point in the history
This PR was merged into the 4.0-dev branch.

Discussion
----------

Remove some more PHP < 7.1.3 code

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no <!-- don't forget updating src/**/CHANGELOG.md files -->
| BC breaks?    | no
| Deprecations? | no <!-- don't forget updating UPGRADE-*.md files -->
| Tests pass?   | yes
| Fixed tickets | N/A
| License       | MIT
| Doc PR        | N/A

Commits
-------

ff77cde Remove some more PHP < 7.1.3 code
  • Loading branch information
nicolas-grekas committed May 25, 2017
2 parents 8e0d41a + ff77cde commit 43d4e5b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 19 deletions.
15 changes: 1 addition & 14 deletions src/Symfony/Component/HttpFoundation/Request.php
Expand Up @@ -300,20 +300,7 @@ public function initialize(array $query = array(), array $request = array(), arr
*/
public static function createFromGlobals()
{
// With the php's bug #66606, the php's built-in web server
// stores the Content-Type and Content-Length header values in
// HTTP_CONTENT_TYPE and HTTP_CONTENT_LENGTH fields.
$server = $_SERVER;
if ('cli-server' === PHP_SAPI) {
if (array_key_exists('HTTP_CONTENT_LENGTH', $_SERVER)) {
$server['CONTENT_LENGTH'] = $_SERVER['HTTP_CONTENT_LENGTH'];
}
if (array_key_exists('HTTP_CONTENT_TYPE', $_SERVER)) {
$server['CONTENT_TYPE'] = $_SERVER['HTTP_CONTENT_TYPE'];
}
}

$request = self::createRequestFromFactory($_GET, $_POST, array(), $_COOKIE, $_FILES, $server);
$request = self::createRequestFromFactory($_GET, $_POST, array(), $_COOKIE, $_FILES, $_SERVER);

if (0 === strpos($request->headers->get('CONTENT_TYPE'), 'application/x-www-form-urlencoded')
&& in_array(strtoupper($request->server->get('REQUEST_METHOD', 'GET')), array('PUT', 'DELETE', 'PATCH'))
Expand Down
6 changes: 1 addition & 5 deletions src/Symfony/Component/Yaml/Tests/InlineTest.php
Expand Up @@ -551,11 +551,7 @@ public function testParseNestedTimestampListAsDateTimeObject($yaml, $year, $mont
$expected = new \DateTime($yaml);
$expected->setTimeZone(new \DateTimeZone('UTC'));
$expected->setDate($year, $month, $day);
if (PHP_VERSION_ID >= 70100) {
$expected->setTime($hour, $minute, $second, 1000000 * ($second - (int) $second));
} else {
$expected->setTime($hour, $minute, $second);
}
$expected->setTime($hour, $minute, $second, 1000000 * ($second - (int) $second));

$expectedNested = array('nested' => array($expected));
$yamlNested = "{nested: [$yaml]}";
Expand Down

0 comments on commit 43d4e5b

Please sign in to comment.