MediaWiki
REL1_37
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
41
public
function
__construct
( callable $cb ) {
42
$this->stream = Utils::streamFor();
43
$this->callback = $cb;
44
}
45
46
public
function
write
( $string ) {
47
return
call_user_func( $this->callback, $this, $string );
48
}
49
}
MWCallbackStream
Definition
MWCallbackStream.php:36
MWCallbackStream\$callback
$callback
Definition
MWCallbackStream.php:39
MWCallbackStream\write
write( $string)
Definition
MWCallbackStream.php:46
MWCallbackStream\__construct
__construct(callable $cb)
Definition
MWCallbackStream.php:41
includes
http
MWCallbackStream.php
Generated on Fri Apr 5 2024 23:40:20 for MediaWiki by
1.9.8