<commit_before><?php

namespace frostealth\yii2\aws\s3\commands;

use Aws\ResultInterface;
use frostealth\yii2\aws\s3\base\commands\ExecutableCommand;
use frostealth\yii2\aws\s3\base\commands\traits\Async;
use frostealth\yii2\aws\s3\interfaces\commands\Asynchronous;
use frostealth\yii2\aws\s3\interfaces\commands\HasAcl;
use frostealth\yii2\aws\s3\interfaces\commands\HasBucket;
use GuzzleHttp\Promise\PromiseInterface;

/**
 * Class UploadCommand
 *
 * @method ResultInterface|PromiseInterface execute()
 *
 * @package frostealth\yii2\aws\s3\commands
 */
class UploadCommand extends ExecutableCommand implements HasBucket, HasAcl, Asynchronous
{
    use Async;

    /** @var string */
    protected $bucket;

    /** @var string */
    protected $acl;

    /** @var mixed */
    protected $source;

    /** @var string */
    protected $filename;

    /** @var array */
    protected $options = [];

    /**
     * @return string
     */
    public function getBucket(): string
    {
        return (string)$this->bucket;
    }

    /**
     * @param string $bucket
     *
     * @return $this
     */
    public function setBucket(string $bucket)
    {
        $this->bucket = $bucket;

        return $this;
    }

    /**
     * @return string
     */
    public function getAcl(): string
    {
        return (string)$this->acl;
    }

    /**
     * @param string $acl
     *
     * @return $this
     */
    public function setAcl(string $acl)
    {
        $this->acl = $acl;

        return $this;
    }

    /**
     * @return mixed
     */
    public function getSource()
    {
        return $this->source;
    }

    /**
     * @param mixed $source
     *
     * @return $this
     */
    public function setSource($source)
    {
        $this->source = $source;

        return $this;
    }

    /**
     * @return string
     */
    public function getFilename(): string
    {
        return (string)$this->filename;
    }

    /**
     * @param string $filename
     *
     * @return $this
     */
    public function setFilename(string $filename)
    {
        $this->filename = $filename;

        return $this;
    }

    /**
     * @return int
     */
    public function getPartSize(): int
    {
        return $this->options['part_size'] ?? 0;
    }

    /**
     * @param int $partSize
     *
     * @return $this
     */
    public function setPartSize(int $partSize)
    {
        $this->options['part_size'] = $partSize;

        return $this;
    }

    /**
     * @return int
     */
    public function getConcurrency(): int
    {
        return $this->options['concurrency'] ?? 0;
    }

    /**
     * @param int $concurrency
     *
     * @return $this
     */
    public function setConcurrency(int $concurrency)
    {
        $this->options['concurrency'] = $concurrency;

        return $this;
    }

    /**
     * @return int
     */
    public function getMupThreshold(): int
    {
        return $this->options['mup_threshold'] ?? 0;
    }

    /**
     * @param int $mupThreshold
     *
     * @return $this
     */
    public function setMupThreshold(int $mupThreshold)
    {
        $this->options['mup_threshold'] = $mupThreshold;

        return $this;
    }

    /**
     * @return array
     */
    public function getOptions(): array
    {
        return $this->options;
    }

    /**
     * @param callable $beforeUpload
     *
     * @return $this
     */
    public function beforeUpload(callable $beforeUpload)
    {
        $this->options['before_upload'] = $beforeUpload;

        return $this;
    }
}<commit_msg>added params in UploadCommand; close #16<commit_after><?php

namespace frostealth\yii2\aws\s3\commands;

use Aws\ResultInterface;
use frostealth\yii2\aws\s3\base\commands\ExecutableCommand;
use frostealth\yii2\aws\s3\base\commands\traits\Async;
use frostealth\yii2\aws\s3\interfaces\commands\Asynchronous;
use frostealth\yii2\aws\s3\interfaces\commands\HasAcl;
use frostealth\yii2\aws\s3\interfaces\commands\HasBucket;
use GuzzleHttp\Promise\PromiseInterface;

/**
 * Class UploadCommand
 *
 * @method ResultInterface|PromiseInterface execute()
 *
 * @package frostealth\yii2\aws\s3\commands
 */
class UploadCommand extends ExecutableCommand implements HasBucket, HasAcl, Asynchronous
{
    use Async;

    /** @var string */
    protected $bucket;

    /** @var string */
    protected $acl;

    /** @var mixed */
    protected $source;

    /** @var string */
    protected $filename;

    /** @var array */
    protected $options = [];

    /**
     * @return string
     */
    public function getBucket(): string
    {
        return (string)$this->bucket;
    }

    /**
     * @param string $bucket
     *
     * @return $this
     */
    public function setBucket(string $bucket)
    {
        $this->bucket = $bucket;

        return $this;
    }

    /**
     * @return string
     */
    public function getAcl(): string
    {
        return (string)$this->acl;
    }

    /**
     * @param string $acl
     *
     * @return $this
     */
    public function setAcl(string $acl)
    {
        $this->acl = $acl;

        return $this;
    }

    /**
     * @return mixed
     */
    public function getSource()
    {
        return $this->source;
    }

    /**
     * @param mixed $source
     *
     * @return $this
     */
    public function setSource($source)
    {
        $this->source = $source;

        return $this;
    }

    /**
     * @return string
     */
    public function getFilename(): string
    {
        return (string)$this->filename;
    }

    /**
     * @param string $filename
     *
     * @return $this
     */
    public function setFilename(string $filename)
    {
        $this->filename = $filename;

        return $this;
    }

    /**
     * @return int
     */
    public function getPartSize(): int
    {
        return $this->options['part_size'] ?? 0;
    }

    /**
     * @param int $partSize
     *
     * @return $this
     */
    public function setPartSize(int $partSize)
    {
        $this->options['part_size'] = $partSize;

        return $this;
    }

    /**
     * @return int
     */
    public function getConcurrency(): int
    {
        return $this->options['concurrency'] ?? 0;
    }

    /**
     * @param int $concurrency
     *
     * @return $this
     */
    public function setConcurrency(int $concurrency)
    {
        $this->options['concurrency'] = $concurrency;

        return $this;
    }

    /**
     * @return int
     */
    public function getMupThreshold(): int
    {
        return $this->options['mup_threshold'] ?? 0;
    }

    /**
     * @param int $mupThreshold
     *
     * @return $this
     */
    public function setMupThreshold(int $mupThreshold)
    {
        $this->options['mup_threshold'] = $mupThreshold;

        return $this;
    }

    /**
     * @return string
     */
    public function getContentType(): string
    {
        return $this->getParam('ContentType', '');
    }

    /**
     * @param string $contentType
     *
     * @return $this
     */
    public function setContentType(string $contentType)
    {
        $this->setParam('ContentType', $contentType);

        return $this;
    }

    /**
     * @return string
     */
    public function getContentDisposition(): string
    {
        return $this->getParam('ContentDisposition', '');
    }

    /**
     * @param string $contentDisposition
     *
     * @return $this
     */
    public function setContentDisposition(string $contentDisposition)
    {
        $this->setParam('ContentDisposition', $contentDisposition);

        return $this;
    }

    /**
     * @return array
     */
    public function getParams(): array
    {
        return $this->options['params'] ?? [];
    }

    /**
     * @param array $params
     */
    public function setParams(array $params)
    {
        $this->options['params'] = $params;
    }

    /**
     * @return array
     */
    public function getOptions(): array
    {
        return $this->options;
    }

    /**
     * @param callable $beforeUpload
     *
     * @return $this
     */
    public function beforeUpload(callable $beforeUpload)
    {
        $this->options['before_upload'] = $beforeUpload;

        return $this;
    }

    /**
     * @param string $name
     * @param mixed  $default
     *
     * @return mixed
     */
    protected function getParam(string $name, $default)
    {
        return $this->options['params'][$name] ?? $default;
    }

    /**
     * @param string $name
     * @param mixed  $value
     */
    protected function setParam(string $name, $value)
    {
        $this->options['params'][$name] = $value;
    }
}
{'fraction_non_alphanumeric': 0.13736136783733827, 'fraction_numerical': 0.004158964879852125, 'mean_word_length': 1.9276293540750762, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 43, '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': '7635163', 'n_tokens_mistral': 2722, 'n_tokens_neox': 2643, 'n_words': 539}