private function imageObject($encode) { if ($this->type === self::TYPE_BYTES) { $bytes = (string) $this->image; return ['content' => $encode ? base64_encode($bytes) : $bytes]; } if ($this->type === self::TYPE_STRING) { $string = $this->image; return ['content' => $encode ? base64_encode($string) : $string]; } return ['source' => ['gcsImageUri' => $this->image]]; }