WordPress\AiClientDependencies\Nyholm\Psr7

Stream::write │ public │ WP 1.0

Метод класса: Stream{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

$Stream = new Stream();
$Stream->write( $string ): int;
$string(обязательный)
.

Код Stream::write() WP 7.1.2

public function write($string): int
{
    if (!isset($this->stream)) {
        throw new \RuntimeException('Stream is detached');
    }
    if (!$this->writable) {
        throw new \RuntimeException('Cannot write to a non-writable stream');
    }
    // We can't know the size after writing anything
    $this->size = null;
    if (\false === $result = @\fwrite($this->stream, $string)) {
        throw new \RuntimeException('Unable to write to stream: ' . (\error_get_last()['message'] ?? ''));
    }
    return $result;
}