Use psalm-return instead of return for generics

This commit is contained in:
2021-09-19 00:44:20 +03:00
parent 5e43f9b0df
commit bac144582e
6 changed files with 14 additions and 14 deletions

View File

@ -60,7 +60,7 @@ abstract class Connection
}
/**
* @return Promise<void>
* @psalm-return Promise<void>
*/
public function connect(): Promise
{
@ -237,7 +237,7 @@ abstract class Connection
}
/**
* @return Promise<Frame\Response>
* @psalm-return Promise<Frame\Response>
*/
private function response(Stream $stream, Buffer $buffer): Promise
{

View File

@ -136,7 +136,7 @@ final class Consumer extends Connection
/**
* Update RDY state (indicate you are ready to receive N messages).
*
* @return Promise<bool>
* @psalm-return Promise<bool>
*/
public function rdy(int $count): Promise
{
@ -165,7 +165,7 @@ final class Consumer extends Connection
/**
* Finish a message (indicate successful processing).
*
* @return Promise<bool>
* @psalm-return Promise<bool>
*
* @internal
*/
@ -192,7 +192,7 @@ final class Consumer extends Connection
* be explicitly relied upon and may change in the future. Similarly, a message that is in-flight and times out
* behaves identically to an explicit REQ.
*
* @return Promise<bool>
* @psalm-return Promise<bool>
*
* @internal
*/
@ -216,7 +216,7 @@ final class Consumer extends Connection
/**
* Reset the timeout for an in-flight message.
*
* @return Promise<bool>
* @psalm-return Promise<bool>
*
* @internal
*/

View File

@ -30,7 +30,7 @@ final class Response extends Frame
}
/**
* @return array<mixed, mixed>
* @psalm-return array<mixed, mixed>
*/
public function toArray(): array
{

View File

@ -93,7 +93,7 @@ final class Producer extends Connection
*
* @psalm-param positive-int|0 $delay
*
* @return Promise<bool>
* @psalm-return Promise<bool>
*/
public function publish(string $topic, string | array $body, int $delay = 0): Promise
{

View File

@ -10,12 +10,12 @@ use Amp\Promise;
interface Stream
{
/**
* @return Promise<null|string>
* @psalm-return Promise<null|string>
*/
public function read(): Promise;
/**
* @return Promise<void>
* @psalm-return Promise<void>
*/
public function write(string $data): Promise;

View File

@ -19,7 +19,7 @@ class SocketStream implements Stream
}
/**
* @return Promise<self>
* @psalm-return Promise<self>
*/
public static function connect(string $uri, int $timeout = 0, int $attempts = 0, bool $noDelay = false): Promise
{
@ -48,7 +48,7 @@ class SocketStream implements Stream
}
/**
* @return Promise<null|string>
* @psalm-return Promise<null|string>
*/
public function read(): Promise
{
@ -56,7 +56,7 @@ class SocketStream implements Stream
}
/**
* @return Promise<void>
* @psalm-return Promise<void>
*/
public function write(string $data): Promise
{
@ -72,7 +72,7 @@ class SocketStream implements Stream
}
/**
* @return Promise<void>
* @psalm-return Promise<void>
*/
public function setupTls(): Promise
{