src/Types/BaseType.php
public function attachment($data = null, $mimeType = 'application/octet-stream')
    {
        if ($data !== null) {
            if (is_array($data)) {
                $this->attachment['data'] = array_key_exists('data', $data) ? $data['data'] : null;
                $this->attachment['mimeType'] = array_key_exists('mimeType', $data) ? $data['mimeType'] : 'application/octet-stream';
            } else {
                $this->attachment['data'] = $data;
                $this->attachment['mimeType'] = $mimeType;
            }
        }

        return $this->attachment;
    }
public function attachment($data = null, $mimeType = 'application/octet-stream')
    {
        if ($data !== null) {
            if (is_array($data)) {
                $this->attachment['data'] = array_key_exists('data', $data) ? $data['data'] : null;
                $this->attachment['mimeType'] = array_key_exists('mimeType', $data) ? $data['mimeType'] : 'application/octet-stream';
            } else {
                $this->attachment['data'] = $data;
                $this->attachment['mimeType'] = $mimeType;
            }
        }

        return $this->attachment;
    }
Method to get or set the object's attachment. Overrides any existing attachment is setting.

@param mixed $data If a string it is assumed to be the contents of the attachment. If an array copy its values across.
@param string $mimeType The MIME type of the attachment that will be used in the request. Defaults to application/octet-stream.

@return mixed Returns the contents of the current atachment or null if none has been specified.