<commit_before><?php

namespace Suyabay\Http\Repository;

use Storage;
use Session;
use Cloudder;
use Suyabay\Http\Requests;
use Illuminate\Http\Request;
use Aws\S3\Exception\S3Exception as S3;
use Aws\Exception\AwsException as AWS;
use Suyabay\Http\Controllers\Controller;
use Illuminate\Contracts\Filesystem\Filesystem;

class FilesRepository
{
    /**
     * Upload file to amazon S3
     * @param  [type] $podcast [description]
     * @return [type]          [description]
     */
    public function toAmazon($podcast)
    {
        $fileName = time() . '.' . $podcast->getClientOriginalExtension();
        $s3 = Storage::disk('s3');

        $s3->put($fileName, fopen($podcast, 'r+'));

        return $s3->getDriver()->getAdapter()->getClient()->getObjectUrl('suyabay', $fileName);
    }

    /**
     * Upload file to cloudinary
     * @param  [type] $cover [description]
     * @return [type]        [description]
     */
    public function imageToCloudinary($cover)
    {
        Cloudder::upload($cover, null, ["width" => 500, "height" => 375, "crop" => "scale"]);
        
        return Cloudder::getResult()['url'];
    }

    /**
     * Upload audio file to cloudinary
     * @param  [type] $filename [description]
     * @return [type]           [description]
     */
    public function videoToCloudinary($podcast)
    {
        Cloudder::uploadVideo($podcast, null);

        return Cloudder::getResult()['url'];
    }  <commit_msg>[Fixes][#112126869]Fix Nitpick issues<commit_after><?php

namespace Suyabay\Http\Repository;

use Storage;
use Session;
use Cloudder;
use Suyabay\Http\Requests;
use Illuminate\Http\Request;
use Aws\Exception\AwsException as AWS;
use Aws\S3\Exception\S3Exception as S3;
use Suyabay\Http\Controllers\Controller;
use Illuminate\Contracts\Filesystem\Filesystem;

class FilesRepository
{
    /**
     * Upload file to cloudinary
     * @param  [type] $cover [description]
     * @return [type]        [description]
     */
    public function imageToCloudinary($cover)
    {
        Cloudder::upload($cover, null, ["width" => 500, "height" => 375, "crop" => "scale"]);

        return Cloudder::getResult()['url'];
    }

    /**
     * Upload audio file to cloudinary
     * @param $filename
     * @return 
     */
    public function videoToCloudinary($podcast)
    {
        Cloudder::uploadVideo($podcast, null);

        return Cloudder::getResult()['url'];
    }  
{'fraction_non_alphanumeric': 0.14309346567411083, 'fraction_numerical': 0.013234077750206782, 'mean_word_length': 2.9983471074380166, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3091228', 'n_tokens_mistral': 783, 'n_tokens_neox': 771, 'n_words': 164}