File: SampleStreamFactory.inc

package info (click to toggle)
php-psr 1.2.0-9
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 548 kB
  • sloc: ansic: 1,485; pascal: 203; xml: 150; makefile: 2
file content (26 lines) | stat: -rw-r--r-- 669 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php

use Psr\Http\Message\StreamFactoryInterface;
use Psr\Http\Message\StreamInterface;

class SampleStreamFactory implements StreamFactoryInterface
{
    public function createStream(string $content = ''): StreamInterface
    {
        var_dump(__METHOD__, $content);
        return new SampleStream();
    }

    public function createStreamFromFile(string $filename, string $mode = 'r'): StreamInterface
    {
        var_dump(__METHOD__, $filename, $mode);
        return new SampleStream();
    }

    public function createStreamFromResource($resource): StreamInterface
    {
        var_dump(__METHOD__, $resource);
        return new SampleStream();
    }
}