Skip to content

Commit d30aae5

Browse files
committed
Merge branch '4.4' into 5.3
* 4.4: Fix return types for PHP 8.1
2 parents a8388f7 + 5556a4a commit d30aae5

File tree

7 files changed

+16
-5
lines changed

7 files changed

+16
-5
lines changed

File/Stream.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ class Stream extends File
2323
*
2424
* @return int|false
2525
*/
26+
#[\ReturnTypeWillChange]
2627
public function getSize()
2728
{
2829
return false;

HeaderBag.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@ public function removeCacheControlDirective(string $key)
252252
*
253253
* @return \ArrayIterator An \ArrayIterator instance
254254
*/
255+
#[\ReturnTypeWillChange]
255256
public function getIterator()
256257
{
257258
return new \ArrayIterator($this->headers);
@@ -262,6 +263,7 @@ public function getIterator()
262263
*
263264
* @return int The number of headers
264265
*/
266+
#[\ReturnTypeWillChange]
265267
public function count()
266268
{
267269
return \count($this->headers);

ParameterBag.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ public function filter(string $key, $default = null, int $filter = \FILTER_DEFAU
207207
*
208208
* @return \ArrayIterator An \ArrayIterator instance
209209
*/
210+
#[\ReturnTypeWillChange]
210211
public function getIterator()
211212
{
212213
return new \ArrayIterator($this->parameters);
@@ -217,6 +218,7 @@ public function getIterator()
217218
*
218219
* @return int The number of parameters
219220
*/
221+
#[\ReturnTypeWillChange]
220222
public function count()
221223
{
222224
return \count($this->parameters);

Session/Attribute/AttributeBag.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ public function clear()
131131
*
132132
* @return \ArrayIterator An \ArrayIterator instance
133133
*/
134+
#[\ReturnTypeWillChange]
134135
public function getIterator()
135136
{
136137
return new \ArrayIterator($this->attributes);
@@ -141,6 +142,7 @@ public function getIterator()
141142
*
142143
* @return int The number of attributes
143144
*/
145+
#[\ReturnTypeWillChange]
144146
public function count()
145147
{
146148
return \count($this->attributes);

Session/Session.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ public function isStarted()
128128
*
129129
* @return \ArrayIterator An \ArrayIterator instance
130130
*/
131+
#[\ReturnTypeWillChange]
131132
public function getIterator()
132133
{
133134
return new \ArrayIterator($this->getAttributeBag()->all());
@@ -138,6 +139,7 @@ public function getIterator()
138139
*
139140
* @return int
140141
*/
142+
#[\ReturnTypeWillChange]
141143
public function count()
142144
{
143145
return \count($this->getAttributeBag()->all());

Session/Storage/Handler/MemcachedSessionHandler.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ public function __construct(\Memcached $memcached, array $options = [])
5757
/**
5858
* @return bool
5959
*/
60+
#[\ReturnTypeWillChange]
6061
public function close()
6162
{
6263
return $this->memcached->quit();
@@ -73,6 +74,7 @@ protected function doRead(string $sessionId)
7374
/**
7475
* @return bool
7576
*/
77+
#[\ReturnTypeWillChange]
7678
public function updateTimestamp($sessionId, $data)
7779
{
7880
$this->memcached->touch($this->prefix.$sessionId, time() + $this->ttl);

Tests/File/FakeFile.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,28 +17,28 @@ class FakeFile extends OrigFile
1717
{
1818
private $realpath;
1919

20-
public function __construct($realpath, $path)
20+
public function __construct(string $realpath, string $path)
2121
{
2222
$this->realpath = $realpath;
2323
parent::__construct($path, false);
2424
}
2525

26-
public function isReadable()
26+
public function isReadable(): bool
2727
{
2828
return true;
2929
}
3030

31-
public function getRealpath()
31+
public function getRealpath(): string
3232
{
3333
return $this->realpath;
3434
}
3535

36-
public function getSize()
36+
public function getSize(): int
3737
{
3838
return 42;
3939
}
4040

41-
public function getMTime()
41+
public function getMTime(): int
4242
{
4343
return time();
4444
}

0 commit comments

Comments
 (0)