Skip to content

Commit 7ca2875

Browse files
committed
Merge branch '4.4' into 5.2
* 4.4: [HttpFoundation] Add ReturnTypeWillChange to SessionHandlers
2 parents a148e5d + 7239a29 commit 7ca2875

File tree

3 files changed

+21
-3
lines changed

3 files changed

+21
-3
lines changed

Session/Storage/Handler/AbstractSessionHandler.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ abstract class AbstractSessionHandler implements \SessionHandlerInterface, \Sess
3131
/**
3232
* @return bool
3333
*/
34+
#[\ReturnTypeWillChange]
3435
public function open($savePath, $sessionName)
3536
{
3637
$this->sessionName = $sessionName;
@@ -59,6 +60,7 @@ abstract protected function doDestroy(string $sessionId);
5960
/**
6061
* @return bool
6162
*/
63+
#[\ReturnTypeWillChange]
6264
public function validateId($sessionId)
6365
{
6466
$this->prefetchData = $this->read($sessionId);
@@ -79,6 +81,7 @@ public function validateId($sessionId)
7981
/**
8082
* @return string
8183
*/
84+
#[\ReturnTypeWillChange]
8285
public function read($sessionId)
8386
{
8487
if (null !== $this->prefetchId) {
@@ -102,6 +105,7 @@ public function read($sessionId)
102105
/**
103106
* @return bool
104107
*/
108+
#[\ReturnTypeWillChange]
105109
public function write($sessionId, $data)
106110
{
107111
if (null === $this->igbinaryEmptyData) {
@@ -119,6 +123,7 @@ public function write($sessionId, $data)
119123
/**
120124
* @return bool
121125
*/
126+
#[\ReturnTypeWillChange]
122127
public function destroy($sessionId)
123128
{
124129
if (!headers_sent() && filter_var(ini_get('session.use_cookies'), \FILTER_VALIDATE_BOOLEAN)) {

Session/Storage/Handler/StrictSessionHandler.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ public function __construct(\SessionHandlerInterface $handler)
3333
/**
3434
* @return bool
3535
*/
36+
#[\ReturnTypeWillChange]
3637
public function open($savePath, $sessionName)
3738
{
3839
parent::open($savePath, $sessionName);
@@ -51,6 +52,7 @@ protected function doRead(string $sessionId)
5152
/**
5253
* @return bool
5354
*/
55+
#[\ReturnTypeWillChange]
5456
public function updateTimestamp($sessionId, $data)
5557
{
5658
return $this->write($sessionId, $data);
@@ -67,6 +69,7 @@ protected function doWrite(string $sessionId, string $data)
6769
/**
6870
* @return bool
6971
*/
72+
#[\ReturnTypeWillChange]
7073
public function destroy($sessionId)
7174
{
7275
$this->doDestroy = true;
@@ -88,14 +91,16 @@ protected function doDestroy(string $sessionId)
8891
/**
8992
* @return bool
9093
*/
94+
#[\ReturnTypeWillChange]
9195
public function close()
9296
{
9397
return $this->handler->close();
9498
}
9599

96100
/**
97-
* @return bool
101+
* @return int|false
98102
*/
103+
#[\ReturnTypeWillChange]
99104
public function gc($maxlifetime)
100105
{
101106
return $this->handler->gc($maxlifetime);

Session/Storage/Proxy/SessionHandlerProxy.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public function getHandler()
3838
/**
3939
* @return bool
4040
*/
41+
#[\ReturnTypeWillChange]
4142
public function open($savePath, $sessionName)
4243
{
4344
return (bool) $this->handler->open($savePath, $sessionName);
@@ -46,6 +47,7 @@ public function open($savePath, $sessionName)
4647
/**
4748
* @return bool
4849
*/
50+
#[\ReturnTypeWillChange]
4951
public function close()
5052
{
5153
return (bool) $this->handler->close();
@@ -54,6 +56,7 @@ public function close()
5456
/**
5557
* @return string
5658
*/
59+
#[\ReturnTypeWillChange]
5760
public function read($sessionId)
5861
{
5962
return (string) $this->handler->read($sessionId);
@@ -62,6 +65,7 @@ public function read($sessionId)
6265
/**
6366
* @return bool
6467
*/
68+
#[\ReturnTypeWillChange]
6569
public function write($sessionId, $data)
6670
{
6771
return (bool) $this->handler->write($sessionId, $data);
@@ -70,22 +74,25 @@ public function write($sessionId, $data)
7074
/**
7175
* @return bool
7276
*/
77+
#[\ReturnTypeWillChange]
7378
public function destroy($sessionId)
7479
{
7580
return (bool) $this->handler->destroy($sessionId);
7681
}
7782

7883
/**
79-
* @return bool
84+
* @return int|false
8085
*/
86+
#[\ReturnTypeWillChange]
8187
public function gc($maxlifetime)
8288
{
83-
return (bool) $this->handler->gc($maxlifetime);
89+
return $this->handler->gc($maxlifetime);
8490
}
8591

8692
/**
8793
* @return bool
8894
*/
95+
#[\ReturnTypeWillChange]
8996
public function validateId($sessionId)
9097
{
9198
return !$this->handler instanceof \SessionUpdateTimestampHandlerInterface || $this->handler->validateId($sessionId);
@@ -94,6 +101,7 @@ public function validateId($sessionId)
94101
/**
95102
* @return bool
96103
*/
104+
#[\ReturnTypeWillChange]
97105
public function updateTimestamp($sessionId, $data)
98106
{
99107
return $this->handler instanceof \SessionUpdateTimestampHandlerInterface ? $this->handler->updateTimestamp($sessionId, $data) : $this->write($sessionId, $data);

0 commit comments

Comments
 (0)