1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-15 10:57:08 +01:00
psalm/src/Psalm/Internal/LanguageServer/ProtocolStreamWriter.php
Matthew Brown da42be175f Apply PHPCS fixes
Fixes #1880
2019-07-05 16:27:53 -04:00

34 lines
608 B
PHP

<?php
declare(strict_types = 1);
namespace Psalm\Internal\LanguageServer;
use Amp\ByteStream\ResourceOutputStream;
use Amp\Promise;
/**
* @internal
*/
class ProtocolStreamWriter implements ProtocolWriter
{
/**
* @var \Amp\ByteStream\ResourceOutputStream
*/
private $output;
/**
* @param resource $output
*/
public function __construct($output)
{
$this->output = new ResourceOutputStream($output);
}
/**
* {@inheritdoc}
*/
public function write(Message $msg): Promise
{
return $this->output->write((string)$msg);
}
}