Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 09a5969

Browse filesBrowse files
committed
[HttpFoundation] removed deprecated Request::splitHttpAcceptHeader() method
1 parent c28f1b0 commit 09a5969
Copy full SHA for 09a5969

File tree

Expand file treeCollapse file tree

2 files changed

+0
-62
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+0
-62
lines changed

‎src/Symfony/Component/HttpFoundation/Request.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpFoundation/Request.php
-25Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1426,31 +1426,6 @@ public function isXmlHttpRequest()
14261426
return 'XMLHttpRequest' == $this->headers->get('X-Requested-With');
14271427
}
14281428

1429-
/**
1430-
* Splits an Accept-* HTTP header.
1431-
*
1432-
* @param string $header Header to split
1433-
*
1434-
* @return array Array indexed by the values of the Accept-* header in preferred order
1435-
*
1436-
* @deprecated Deprecated since version 2.2, to be removed in 2.3.
1437-
*/
1438-
public function splitHttpAcceptHeader($header)
1439-
{
1440-
trigger_error('splitHttpAcceptHeader() is deprecated since version 2.2 and will be removed in 2.3.', E_USER_DEPRECATED);
1441-
1442-
$headers = array();
1443-
foreach (AcceptHeader::fromString($header)->all() as $item) {
1444-
$key = $item->getValue();
1445-
foreach ($item->getAttributes() as $name => $value) {
1446-
$key .= sprintf(';%s=%s', $name, $value);
1447-
}
1448-
$headers[$key] = $item->getQuality();
1449-
}
1450-
1451-
return $headers;
1452-
}
1453-
14541429
/*
14551430
* The following methods are derived from code of the Zend Framework (1.10dev - 2010-01-24)
14561431
*

‎src/Symfony/Component/HttpFoundation/Tests/RequestTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpFoundation/Tests/RequestTest.php
-37Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,6 @@
1717

1818
class RequestTest extends \PHPUnit_Framework_TestCase
1919
{
20-
public function deprecationErrorHandler($errorNumber, $message, $file, $line, $context)
21-
{
22-
if ($errorNumber & E_USER_DEPRECATED) {
23-
return true;
24-
}
25-
26-
return \PHPUnit_Util_ErrorHandler::handleError($errorNumber, $message, $file, $line);
27-
}
28-
2920
/**
3021
* @covers Symfony\Component\HttpFoundation\Request::__construct
3122
*/
@@ -908,8 +899,6 @@ public function testOverrideGlobals()
908899

909900
// restore initial $_SERVER array
910901
$_SERVER = $server;
911-
912-
restore_error_handler();
913902
}
914903

915904
public function testGetScriptName()
@@ -1158,32 +1147,6 @@ public function testToString()
11581147
$this->assertContains('Accept-Language: zh, en-us; q=0.8, en; q=0.6', $request->__toString());
11591148
}
11601149

1161-
/**
1162-
* @dataProvider splitHttpAcceptHeaderData
1163-
*/
1164-
public function testSplitHttpAcceptHeader($acceptHeader, $expected)
1165-
{
1166-
$request = new Request();
1167-
1168-
set_error_handler(array($this, "deprecationErrorHandler"));
1169-
$this->assertEquals($expected, $request->splitHttpAcceptHeader($acceptHeader));
1170-
restore_error_handler();
1171-
}
1172-
1173-
public function splitHttpAcceptHeaderData()
1174-
{
1175-
return array(
1176-
array(null, array()),
1177-
array('text/html;q=0.8', array('text/html' => 0.8)),
1178-
array('text/html;foo=bar;q=0.8 ', array('text/html;foo=bar' => 0.8)),
1179-
array('text/html;charset=utf-8; q=0.8', array('text/html;charset=utf-8' => 0.8)),
1180-
array('text/html,application/xml;q=0.9,*/*;charset=utf-8; q=0.8', array('text/html' => 1.0, 'application/xml' => 0.9, '*/*;charset=utf-8' => 0.8)),
1181-
array('text/html,application/xhtml+xml;q=0.9,*/*;q=0.8; foo=bar', array('text/html' => 1.0, 'application/xhtml+xml' => 0.9, '*/*;foo=bar' => 0.8)),
1182-
array('text/html,application/xhtml+xml;charset=utf-8;q=0.9; foo=bar,*/*', array('text/html' => 1.0, '*/*' => 1.0, 'application/xhtml+xml;charset=utf-8;foo=bar' => 0.9)),
1183-
array('text/html,application/xhtml+xml', array('text/html' => 1.0, 'application/xhtml+xml' => 1.0)),
1184-
);
1185-
}
1186-
11871150
public function testIsMethod()
11881151
{
11891152
$request = new Request();

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.