private function addImagesIfGiven($twitterMessage)
    {
        if (is_a($twitterMessage, TwitterStatusUpdate::class) && $twitterMessage->getImages()) {
            $this->twitter->setTimeouts(10, 15);

            $twitterMessage->imageIds = collect($twitterMessage->getImages())->map(function (TwitterImage $image) {
                $media = $this->twitter->upload('media/upload', ['media' => $image->getPath()]);

                return $media->media_id_string;
            });
        }

        return $twitterMessage;
    }
private function addImagesIfGiven($twitterMessage)
    {
        if (is_a($twitterMessage, TwitterStatusUpdate::class) && $twitterMessage->getImages()) {
            $this->twitter->setTimeouts(10, 15);

            $twitterMessage->imageIds = collect($twitterMessage->getImages())->map(function (TwitterImage $image) {
                $media = $this->twitter->upload('media/upload', ['media' => $image->getPath()]);

                return $media->media_id_string;
            });
        }

        return $twitterMessage;
    }
private function addImagesIfGiven ( $ twitterMessage ) { if ( is_a ( $ twitterMessage , TwitterStatusUpdate :: class ) && $ twitterMessage -> getImages ( ) ) { $ this -> twitter -> setTimeouts ( 10 , 15 ) ; $ twitterMessage -> imageIds = collect ( $ twitterMessage -> getImages ( ) ) -> map ( function ( TwitterImage $ image ) { $ media = $ this -> twitter -> upload ( 'media/upload' , [ 'media' => $ image -> getPath ( ) ] ) ; return $ media -> media_id_string ; } ) ; } return $ twitterMessage ; }
If it is a status update message and images are provided, add them.

@param $twitterMessage
@return mixed
If it is a status update message and images are provided add them .