8000 add type-hints /Session folder · symfony/symfony@c5c20c5 · GitHub
[go: up one dir, main page]

Skip to content

Commit c5c20c5

Browse files
julien57xabbuh
julien57
authored andcommitted
add type-hints /Session folder
1 parent 4031bba commit c5c20c5

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function validateId($sessionId)
3737
/**
3838
* {@inheritdoc}
3939
*/
40-
protected function doRead($sessionId)
40+
protected function doRead(string $sessionId)
4141
{
4242
return '';
4343
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ public function gc($maxlifetime)
300300
/**
301301
* {@inheritdoc}
302302
*/
303-
protected function doDestroy($sessionId)
303+
protected function doDestroy(string $sessionId)
304304
{
305305
// delete the record associated with this id
306306
$sql = "DELETE FROM $this->table WHERE $this->idCol = :id";
@@ -321,7 +321,7 @@ protected function doDestroy($sessionId)
321321
/**
322322
* {@inheritdoc}
323323
*/
324-
protected function doWrite($sessionId, $data)
324+
protected function doWrite(string $sessionId, string $data)
325325
{
326326
$maxlifetime = (int) ini_get('session.gc_maxlifetime');
327327

@@ -607,7 +607,7 @@ private function rollback()
607607
*
608608
* @return string The session data
609609
*/
610-
protected function doRead($sessionId)
610+
protected function doRead(string $sessionId)
611611
{
612612
if (self::LOCK_ADVISORY === $this->lockMode) {
613613
$this->unlockStatements[] = $this->doAdvisoryLock($sessionId);

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,15 @@ public function __construct($redis, array $options = [])
6363
/**
6464
* {@inheritdoc}
6565
*/
66-
protected function doRead($sessionId): string
66+
protected function doRead(string $sessionId): string
6767
{
6868
return $this->redis->get($this->prefix.$sessionId) ?: '';
6969
}
7070

7171
/**
7272
* {@inheritdoc}
7373
*/
74-
protected function doWrite($sessionId, $data): bool
74+
protected function doWrite(string $sessionId, string $data): bool
7575
{
7676
$result = $this->redis->setEx($this->prefix.$sessionId, (int) ini_get('session.gc_maxlifetime'), $data);
7777

@@ -81,7 +81,7 @@ protected function doWrite($sessionId, $data): bool
8181
/**
8282
* {@inheritdoc}
8383
*/
84-
protected function doDestroy($sessionId): bool
84+
protected function doDestroy(string $sessionId): bool
8585
{
8686
$this->redis->del($this->prefix.$sessionId);
8787

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function open($savePath, $sessionName)
4343
/**
4444
* {@inheritdoc}
4545
*/
46-
protected function doRead($sessionId)
46+
protected function doRead(string $sessionId)
4747
{
4848
return $this->handler->read($sessionId);
4949
}
@@ -59,7 +59,7 @@ public function updateTimestamp($sessionId, $data)
5959
/**
6060
* {@inheritdoc}
6161
*/
62-
protected function doWrite($sessionId, $data)
62+
protected function doWrite(string $sessionId, string $data)
6363
{
6464
return $this->handler->write($sessionId, $data);
6565
}
@@ -78,7 +78,7 @@ public function destroy($sessionId)
7878
/**
7979
* {@inheritdoc}
8080
*/
81-
protected function doDestroy($sessionId)
81+
protected function doDestroy(string $sessionId)
8282
{
8383
$this->doDestroy = false;
8484

0 commit comments

Comments
 (0)
0