Skip to content

Commit 4cb6b54

Browse files
committed
Fix deprecations for return types in Swift_KeyCache_SimpleKeyCacheInputStream::write()
1 parent dde75bb commit 4cb6b54

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed

lib/classes/Swift/KeyCache/SimpleKeyCacheInputStream.php

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,22 @@
1515
*/
1616
class Swift_KeyCache_SimpleKeyCacheInputStream implements Swift_KeyCache_KeyCacheInputStream
1717
{
18-
/** The KeyCache being written to */
18+
/**
19+
* @var Swift_KeyCache The KeyCache being written to
20+
*/
1921
private $_keyCache;
2022

21-
/** The nsKey of the KeyCache being written to */
23+
/**
24+
* @var string The nsKey of the KeyCache being written to
25+
*/
2226
private $_nsKey;
2327

2428
/** The itemKey of the KeyCache being written to */
2529
private $_itemKey;
2630

27-
/** A stream to write through on each write() */
31+
/**
32+
* @var Swift_InputByteStream|null A stream to write through on each write()
33+
*/
2834
private $_writeThrough = null;
2935

3036
/**
@@ -51,18 +57,23 @@ public function setWriteThroughStream(Swift_InputByteStream $is)
5157
* Writes $bytes to the end of the stream.
5258
*
5359
* @param string $bytes
54-
* @param Swift_InputByteStream $is optional
60+
* @param ?Swift_InputByteStream $is
61+
*
62+
* @throws Swift_IoException
63+
*
64+
* @return int
5565
*/
5666
public function write($bytes, Swift_InputByteStream $is = null)
5767
{
5868
$this->_keyCache->setString(
5969
$this->_nsKey, $this->_itemKey, $bytes, Swift_KeyCache::MODE_APPEND
60-
);
70+
);
71+
6172
if (isset($is)) {
62-
$is->write($bytes);
73+
return $is->write($bytes);
6374
}
6475
if (isset($this->_writeThrough)) {
65-
$this->_writeThrough->write($bytes);
76+
return $this->_writeThrough->write($bytes);
6677
}
6778
}
6879

0 commit comments

Comments
 (0)