MediaWiki
REL1_34
MWCallbackStream.php
Go to the documentation of this file.
1
<?php
21
use Psr\Http\Message\StreamInterface;
22
use GuzzleHttp\Psr7\StreamDecoratorTrait;
23
34
class
MWCallbackStream
implements
StreamInterface {
35
use StreamDecoratorTrait;
36
37
private
$callback
;
38
39
public
function
__construct
( callable $cb ) {
40
$this->stream = GuzzleHttp\Psr7\stream_for();
41
$this->callback = $cb;
42
}
43
44
public
function
write
( $string ) {
45
return
call_user_func( $this->callback, $this, $string );
46
}
47
}
MWCallbackStream
Definition
MWCallbackStream.php:34
MWCallbackStream\$callback
$callback
Definition
MWCallbackStream.php:37
MWCallbackStream\write
write( $string)
Definition
MWCallbackStream.php:44
MWCallbackStream\__construct
__construct(callable $cb)
Definition
MWCallbackStream.php:39
includes
http
MWCallbackStream.php
Generated on Mon Nov 25 2024 16:05:11 for MediaWiki by
1.10.0