MediaWiki
REL1_39
MWCallbackStream.php
Go to the documentation of this file.
1
<?php
21
use GuzzleHttp\Psr7\StreamDecoratorTrait;
22
use GuzzleHttp\Psr7\Utils;
23
use Psr\Http\Message\StreamInterface;
24
36
class
MWCallbackStream
implements
StreamInterface {
37
use StreamDecoratorTrait;
38
39
private
$callback;
40
42
protected
$stream
;
43
44
public
function
__construct
( callable $cb ) {
45
$this->stream = Utils::streamFor();
46
$this->callback = $cb;
47
}
48
49
public
function
write
( $string ) {
50
return
call_user_func( $this->callback, $this, $string );
51
}
52
}
MWCallbackStream
Definition
MWCallbackStream.php:36
MWCallbackStream\write
write( $string)
Definition
MWCallbackStream.php:49
MWCallbackStream\$stream
StreamInterface $stream
Definition
MWCallbackStream.php:42
MWCallbackStream\__construct
__construct(callable $cb)
Definition
MWCallbackStream.php:44
includes
http
MWCallbackStream.php
Generated on Mon Dec 23 2024 06:23:27 for MediaWiki by
1.10.0