1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-25 00:02:40 +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:
Andre Klapper 2024-07-28 19:24:07 +02:00
parent 84210cedc6
commit 06028fad3c

View file

@ -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() {