Amp\Artax\FileBody::getLength PHP Method

getLength() public method

Retrieve the entity body's content length
public getLength ( ) : Amp\Promise
return Amp\Promise
    public function getLength()
    {
        // @TODO Implement non-blocking php-uv file size retrieval.
        // For now we'll just use the dumb blocking version.
        // v1.0.0 cannot be a thing until this is implemented.
        $size = @filesize($this->path);
        if ($size === false) {
            return new Failure(new \RuntimeException(sprintf('Could not determine file size for FileBody: %s', $this->path)));
        }
        return new Success($size);
    }