src/Robtimus/Multipart/MultipartRelated.php
/**
     * Adds a part.
     * @param string|resource|callable $content the part's content.
     *        If it's a callable it should take a length argument and return a string that is not larger than the input.
     * @param string $contentType the part's content type.
     * @param int $contentLength the part's content length, or -1 if not known. Ignored if the part's content is a string.
     * @param string $contentTransferEncoding the optional content transfer encoding.
     * @return MultipartRelated this object.
     */
Adds a part.
@param string|resource|callable $content the part's content.
If it's a callable it should take a length argument and return a string that is not larger than the input.
@param string $contentType the part's content type.
@param int $contentLength the part's content length, or -1 if not known. Ignored if the part's content is a string.
@param string $contentTransferEncoding the optional content transfer encoding.
@return MultipartRelated this object.
Adds a part . @param string|resource|callable $content the part ' s content . If it ' s a callable it should take a length argument and return a string that is not larger than the input . @param string $contentType the part ' s content type . @param int $contentLength the part ' s content length or - 1 if not known . Ignored if the part ' s content is a string . @param string $contentTransferEncoding the optional content transfer encoding . @return MultipartRelated this object .
public function addPart($content, $contentType, $contentLength = -1, $contentTransferEncoding = '') {
        Util::validateStreamable($content, '$content');
        Util::validateNonEmptyString($contentType, '$contentType');
        Util::validateInt($contentLength, '$contentLength');
        Util::validateString($contentTransferEncoding, '$contentTransferEncoding');
        $this->startPart();
        $this->addContentType($contentType);
        if ($contentTransferEncoding !== '') {
            $this->addContentTransferEncoding($contentTransferEncoding);
        }
        $this->endHeaders();
        $this->addContent($content, $contentLength);
        $this->endPart();
        return $this;
    }
public function addPart ( $ content , $ contentType , $ contentLength = - 1 , $ contentTransferEncoding = '' ) { Util :: validateStreamable ( $ content , '$content' ) ; Util :: validateNonEmptyString ( $ contentType , '$contentType' ) ; Util :: validateInt ( $ contentLength , '$contentLength' ) ; Util :: validateString ( $ contentTransferEncoding , '$contentTransferEncoding' ) ; $ this -> startPart ( ) ; $ this -> addContentType ( $ contentType ) ; if ( $ contentTransferEncoding !== '' ) { $ this -> addContentTransferEncoding ( $ contentTransferEncoding ) ; } $ this -> endHeaders ( ) ; $ this -> addContent ( $ content , $ contentLength ) ; $ this -> endPart ( ) ; return $ this ; }
Adds a part.
Adds a part .