WordPress\AiClientDependencies\Nyholm\Psr7
Stream::write
Method of the class: Stream{}
No Hooks.
Returns
null. Nothing (null).
Usage
$Stream = new Stream(); $Stream->write( $string ): int;
- $string(required)
- .
Stream::write() Stream::write code WP 7.0
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;
}