minor #22179 [HttpFoundation] Fix bad merge (nicolas-grekas)
This PR was merged into the 3.3-dev branch.
Discussion
----------
[HttpFoundation] Fix bad merge
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Bad merge, code had been removed in #21465
Commits
-------
af1eed9
[HttpFoundation] Fix bad merge
This commit is contained in:
commit
195e464d98
@ -185,29 +185,6 @@ class Response
|
||||
510 => 'Not Extended', // RFC2774
|
||||
511 => 'Network Authentication Required', // RFC6585
|
||||
);
|
||||
private static $deprecatedMethods = array(
|
||||
'setDate', 'getDate',
|
||||
'setExpires', 'getExpires',
|
||||
'setLastModified', 'getLastModified',
|
||||
'setProtocolVersion', 'getProtocolVersion',
|
||||
'setStatusCode', 'getStatusCode',
|
||||
'setCharset', 'getCharset',
|
||||
'setPrivate', 'setPublic',
|
||||
'getAge', 'getMaxAge', 'setMaxAge', 'setSharedMaxAge',
|
||||
'getTtl', 'setTtl', 'setClientTtl',
|
||||
'getEtag', 'setEtag',
|
||||
'hasVary', 'getVary', 'setVary',
|
||||
'isInvalid', 'isSuccessful', 'isRedirection',
|
||||
'isClientError', 'isOk', 'isForbidden',
|
||||
'isNotFound', 'isRedirect', 'isEmpty',
|
||||
);
|
||||
private static $deprecationsTriggered = array(
|
||||
__CLASS__ => true,
|
||||
BinaryFileResponse::class => true,
|
||||
JsonResponse::class => true,
|
||||
RedirectResponse::class => true,
|
||||
StreamedResponse::class => true,
|
||||
);
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
@ -225,23 +202,6 @@ class Response
|
||||
$this->setStatusCode($status);
|
||||
$this->setProtocolVersion('1.0');
|
||||
|
||||
// Deprecations
|
||||
$class = get_class($this);
|
||||
if ($this instanceof \PHPUnit_Framework_MockObject_MockObject || $this instanceof \Prophecy\Doubler\DoubleInterface) {
|
||||
$class = get_parent_class($class);
|
||||
}
|
||||
if (isset(self::$deprecationsTriggered[$class])) {
|
||||
return;
|
||||
}
|
||||
|
||||
self::$deprecationsTriggered[$class] = true;
|
||||
foreach (self::$deprecatedMethods as $method) {
|
||||
$r = new \ReflectionMethod($class, $method);
|
||||
if (__CLASS__ !== $r->getDeclaringClass()->getName()) {
|
||||
@trigger_error(sprintf('Extending %s::%s() in %s is deprecated since version 3.2 and won\'t be supported anymore in 4.0 as it will be final.', __CLASS__, $method, $class), E_USER_DEPRECATED);
|
||||
}
|
||||
}
|
||||
|
||||
/* RFC2616 - 14.18 says all Responses need to have a Date */
|
||||
if (!$this->headers->has('Date')) {
|
||||
$this->setDate(new \DateTime(null, new \DateTimeZone('UTC')));
|
||||
|
Reference in New Issue
Block a user