Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix return types for PHP 8.1 #42379

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public function __construct(AbstractSessionHandler $handler, MarshallerInterface
/**
* @return bool
*/
#[\ReturnTypeWillChange]
public function open($savePath, $name)
{
return $this->handler->open($savePath, $name);
Expand All @@ -38,6 +39,7 @@ public function open($savePath, $name)
/**
* @return bool
*/
#[\ReturnTypeWillChange]
public function close()
{
return $this->handler->close();
Expand All @@ -46,14 +48,16 @@ public function close()
/**
* @return bool
*/
#[\ReturnTypeWillChange]
public function destroy($sessionId)
{
return $this->handler->destroy($sessionId);
}

/**
* @return bool
* @return int|false
*/
#[\ReturnTypeWillChange]
public function gc($maxlifetime)
{
return $this->handler->gc($maxlifetime);
Expand All @@ -62,6 +66,7 @@ public function gc($maxlifetime)
/**
* @return string
*/
#[\ReturnTypeWillChange]
public function read($sessionId)
{
return $this->marshaller->unmarshall($this->handler->read($sessionId));
Expand All @@ -70,6 +75,7 @@ public function read($sessionId)
/**
* @return bool
*/
#[\ReturnTypeWillChange]
public function write($sessionId, $data)
{
$failed = [];
Expand All @@ -85,6 +91,7 @@ public function write($sessionId, $data)
/**
* @return bool
*/
#[\ReturnTypeWillChange]
public function validateId($sessionId)
{
return $this->handler->validateId($sessionId);
Expand All @@ -93,6 +100,7 @@ public function validateId($sessionId)
/**
* @return bool
*/
#[\ReturnTypeWillChange]
public function updateTimestamp($sessionId, $data)
{
return $this->handler->updateTimestamp($sessionId, $data);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function testGc()
$marshallingSessionHandler = new MarshallingSessionHandler($this->handler, $this->marshaller);

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

$marshallingSessionHandler->gc(4711);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public function testAnonymousClass()
, $c
);

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

$this->assertDumpMatchesFormat(
<<<'EOTXT'
Expand Down