mirror of
https://we.phorge.it/source/arcanist.git
synced 2024-11-21 22:32:41 +01:00
Add return statements for PhutilChannelChannel::readBytes()/writeBytes()
Summary: PHPStan complains that `Method PhutilChannelChannel::readBytes() should return string but return statement is missing.` and `Method PhutilChannelChannel::writeBytes() should return int but return statement is missing.` All other subclasses of `PhutilChannel` implementing these two methods either provide a return value or directly throw an exception. `PhutilChannelChannel` throws an exception for both methods but hadn't explicitly declared that as a `return` statement. Test Plan: Run static code analysis; read/grep the code. Reviewers: O1 Blessed Committers, valerio.bozzolan Reviewed By: O1 Blessed Committers, valerio.bozzolan Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno Differential Revision: https://we.phorge.it/D25754
This commit is contained in:
parent
84210cedc6
commit
06028fad3c
1 changed files with 2 additions and 0 deletions
|
@ -53,10 +53,12 @@ abstract class PhutilChannelChannel extends PhutilChannel {
|
||||||
|
|
||||||
protected function readBytes($length) {
|
protected function readBytes($length) {
|
||||||
$this->throwOnRawByteOperations();
|
$this->throwOnRawByteOperations();
|
||||||
|
return ''; // Never returned but makes static code analyzers happy
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function writeBytes($bytes) {
|
protected function writeBytes($bytes) {
|
||||||
$this->throwOnRawByteOperations();
|
$this->throwOnRawByteOperations();
|
||||||
|
return -1; // Never returned but makes static code analyzers happy
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getReadSockets() {
|
protected function getReadSockets() {
|
||||||
|
|
Loading…
Reference in a new issue