Protobuf\Stream::create PHP Метод

create() публичный статический Метод

Create a new stream.
public static create ( ) : Stream
Результат Stream
    public static function create()
    {
        return new self(fopen('php://temp', 'r+'));
    }

Usage Example

 public function testAddStream()
 {
     $this->assertCount(0, $this->collection);
     $stream1 = Stream::create();
     $stream2 = Stream::create();
     $this->collection[] = $stream1;
     $this->collection->add($stream2);
     $this->assertCount(2, $this->collection);
     $this->assertEquals([$stream1, $stream2], $this->collection->getArrayCopy());
 }
All Usage Examples Of Protobuf\Stream::create