BencodedContent
in package
implements
Stringable, IHttpContent, IBencodeSerialisable
Table of Contents
Interfaces
- Stringable
- IHttpContent
- IBencodeSerialisable
- Provides an interface for serialising objects for bencoding in a controlled manner.
Methods
- __construct() : mixed
- __toString() : string
- bencodeSerialise() : mixed
- Gets the data that should represent this object in a Bencode structure.
- encode() : string
- fromEncoded() : BencodedContent
- fromFile() : BencodedContent
- fromRequest() : BencodedContent
- getContent() : mixed
Methods
__construct()
public
__construct(mixed $content) : mixed
Parameters
- $content : mixed
__toString()
public
__toString() : string
Return values
stringbencodeSerialise()
Gets the data that should represent this object in a Bencode structure.
public
bencodeSerialise() : mixed
Return values
mixed —Representative data.
encode()
public
encode() : string
Return values
stringfromEncoded()
public
static fromEncoded(Stream|string $encoded) : BencodedContent
Parameters
- $encoded : Stream|string
Return values
BencodedContentfromFile()
public
static fromFile(string $path) : BencodedContent
Parameters
- $path : string
Return values
BencodedContentfromRequest()
public
static fromRequest() : BencodedContent
Return values
BencodedContentgetContent()
public
getContent() : mixed