<commit_before><?php

namespace Todstoychev\Icr;

use Illuminate\Support\Facades\File;
use Illuminate\Support\Facades\Storage;
use Symfony\Component\HttpFoundation\File\UploadedFile;

/**
 * Module main facade class
 *
 * @author <NAME> <<EMAIL>>
 * @package Todstoychev\Icr
 */
class Icr
{
    /**
     * Handles upload image. Returns exception instance on error or file name on success.
     *
     * @param UploadedFile $uploadedFile
     * @param string $context
     * @param string $storage
     *
     * @return \Exception|string
     */
    public static function uploadImage(UploadedFile $uploadedFile, $context, $storage = 'local')
    {
        $file = File::get($uploadedFile);
        return app('icr.processor')->upload(
            $context,
            $file,
            $uploadedFile->getClientOriginalExtension(),
            Storage::disk($storage)
        );
    }

    /**
     * Handles delete image. Returns exception instance on error.
     *
     * @param string $fileName
     * @param string $context
     * @param string $storage
     *
     * @return mixed
     */
    public static function deleteImage($fileName, $context, $storage = 'local')
    {
        return app('icr.processor')->delete($fileName, $context, Storage::disk($storage));
    }
}<commit_msg>Some code updates added<commit_after><?php

namespace Todstoychev\Icr;

use Illuminate\Support\Facades\File;
use Illuminate\Support\Facades\Storage;
use Symfony\Component\HttpFoundation\File\UploadedFile;

/**
 * Module main facade class
 *
 * @author <NAME> <<EMAIL>>
 * @package Todstoychev\Icr
 */
class Icr
{
    /**
     * Handles upload image. Returns exception instance on error or file name on success.
     *
     * @param UploadedFile $uploadedFile
     * @param string $context
     * @param string $storage
     *
     * @return \Exception|string
     */
    public static function uploadImage(UploadedFile $uploadedFile, $context, $storage = 'local', $fileName = null)
    {
        $file = File::get($uploadedFile);
        /** @var Processor $processor */
        $processor = app('icr.processor');
        return $processor->upload(
            $context,
            $file,
            $uploadedFile->getClientOriginalExtension(),
            Storage::disk($storage),
            $fileName
        );
    }

    /**
     * Handles delete image. Returns exception instance on error.
     *
     * @param string $fileName
     * @param string $context
     * @param string $storage
     *
     * @return mixed
     */
    public static function deleteImage($fileName, $context, $storage = 'local')
    {
        /** @var Processor $processor */
        $processor = app('icr.processor');

        return $processor->delete($fileName, $context, Storage::disk($storage));
    }
}
{'fraction_non_alphanumeric': 0.12473040977713874, 'fraction_numerical': 0.0, 'mean_word_length': 2.5817245817245817, 'pattern_counts': {'":': 0, '<': 11, '<?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': '1912121', 'n_tokens_mistral': 786, 'n_tokens_neox': 795, 'n_words': 196}