8000 minor #42379 Fix return types for PHP 8.1 (derrabus) · christingruber/symfony@e9b764b · GitHub
[go: up one dir, main page]

Skip to content

Commit e9b764b

Browse files
committed
minor symfony#42379 Fix return types for PHP 8.1 (derrabus)
This PR was merged into the 5.3 branch. Discussion ---------- Fix return types for PHP 8.1 | Q | A | ------------- | --- | Branch? | 5.3 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | symfony#41552 | License | MIT | Doc PR | N/A Follow-up of symfony#42260. Commits ------- ab3c43f Fix return types for PHP 8.1
2 parents bc1b5be + ab3c43f commit e9b764b

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MarshallingSessionHandler.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ public function __construct(AbstractSessionHandler $handler, MarshallerInterface
3030
/**
3131
* @return bool
3232
*/
33+
#[\ReturnTypeWillChange]
3334
public function open($savePath, $name)
3435
{
3536
return $this->handler->open($savePath, $name);
@@ -38,6 +39,7 @@ public function open($savePath, $name)
3839
/**
3940
* @return bool
4041
*/
42+
#[\ReturnTypeWillChange]
4143
public function close()
4244
{
4345
return $this->handler->close();
@@ -46,14 +48,16 @@ public function close()
4648
/**
4749
* @return bool
4850
*/
51+
#[\ReturnTypeWillChange]
4952
public function destroy($sessionId)
5053
{
5154
return $this->handler->destroy($sessionId);
5255
}
5356

5457
/**
55-
* @return bool
58+
* @return int|false
5659
*/
60+
#[\ReturnTypeWillChange]
5761
public function gc($maxlifetime)
5862
{
5963
return $this->handler->gc($maxlifetime);
@@ -62,6 +66,7 @@ public function gc($maxlifetime)
6266
/**
6367
* @return string
6468
*/
69+
#[\ReturnTypeWillChange]
6570
public function read($sessionId)
6671
{
6772
return $this->marshaller->unmarshall($this->handler->read($sessionId));
@@ -70,6 +75,7 @@ public function read($sessionId)
7075
/**
7176
* @return bool
7277
*/
78+
#[\ReturnTypeWillChange]
7379
public function write($sessionId, $data)
7480
{
7581
$failed = [];
@@ -85,6 +91,7 @@ public function write($sessionId, $data)
8591
/**
8692
* @return bool
8793
*/
94+
#[\ReturnTypeWillChange]
8895
public function validateId($sessionId)
8996
{
9097
return $this->handler->validateId($sessionId);
@@ -93,6 +100,7 @@ public function validateId($sessionId)
93100
/**
94101
* @return bool
95102
*/
103+
#[\ReturnTypeWillChange]
96104
public function updateTimestamp($sessionId, $data)
97105
{
98106
return $this->handler->updateTimestamp($sessionId, $data);

src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MarshallingSessionHandlerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public function testGc()
7272
$marshallingSessionHandler = new MarshallingSessionHandler($this->handler, $this->marshaller);
7373

7474
$this->handler->expects($this->once())->method('gc')
75-
->with(4711)->willReturn(true);
75+
->with(4711)->willReturn(1);
7676

7777
$marshallingSessionHandler->gc(4711);
7878
}

src/Symfony/Component/VarDumper/Tests/Caster/CasterTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ public function testAnonymousClass()
164164
, $c
165165
);
166166

167-
$c = eval('return new class implements \Countable { private $foo = "foo"; public function count() { return 0; } };');
167+
$c = eval('return new class implements \Countable { private $foo = "foo"; public function count(): int { return 0; } };');
168168

169169
$this->assertDumpMatchesFormat(
170170
<<<'EOTXT'

0 commit comments

Comments
 (0)
0