<commit_before><?php //-->
/**
 * This file is part of the Cradle PHP Library.
 * (c) 2016-2018 Openovate Labs
 *
 * Copyright and license information can be found at LICENSE.txt
 * distributed with this package.
 */

namespace Cradle\Http\Request;

/**
 * Designed for the Request Object; Adds methods to store $_FILES data
 *
 * @vendor   Cradle
 * @package  Http
 * @author   <NAME> <<EMAIL>>
 * @standard PSR-2
 */
trait FileTrait
{
    /**
     * Returns $_FILES given name or all $_FILES
     *
     * @param mixed ...$args
     *
     * @return mixed
     */
    public function getFiles(...$args)
    {
        return $this->get('files', ...$args);
    }
    
    /**
     * Removes $_FILES given name or all $_FILES
     *
     * @param mixed ...$args
     *
     * @return bool
     */
    public function removeFiles(...$args)
    {
        return $this->remove('files', ...$args);
    }
    
    /**
     * Returns true if has $_FILES given name or if $_FILES is set
     *
     * @param mixed ...$args
     *
     * @return bool
     */
    public function hasFiles(...$args)
    {
        return $this->exists('files', ...$args);
    }

    /**
     * Sets $_FILES
     *
     * @param *array $data
     * @param mixed  ...$args
     *
     * @return FileTrait
     */
    public function setFiles($data, ...$args)
    {
        if (is_array($data)) {
            return $this->set('cookie', $data);
        }
        
        if (count($args) === 0) {
            return $this;
        }
        
        return $this->set('files', $data, ...$args);
    }
}<commit_msg>hot fix files storing to cookie<commit_after><?php //-->
/**
 * This file is part of the Cradle PHP Library.
 * (c) 2016-2018 Openovate Labs
 *
 * Copyright and license information can be found at LICENSE.txt
 * distributed with this package.
 */

namespace Cradle\Http\Request;

/**
 * Designed for the Request Object; Adds methods to store $_FILES data
 *
 * @vendor   Cradle
 * @package  Http
 * @author   <NAME> <<EMAIL>>
 * @standard PSR-2
 */
trait FileTrait
{
    /**
     * Returns $_FILES given name or all $_FILES
     *
     * @param mixed ...$args
     *
     * @return mixed
     */
    public function getFiles(...$args)
    {
        return $this->get('files', ...$args);
    }

    /**
     * Removes $_FILES given name or all $_FILES
     *
     * @param mixed ...$args
     *
     * @return bool
     */
    public function removeFiles(...$args)
    {
        return $this->remove('files', ...$args);
    }

    /**
     * Returns true if has $_FILES given name or if $_FILES is set
     *
     * @param mixed ...$args
     *
     * @return bool
     */
    public function hasFiles(...$args)
    {
        return $this->exists('files', ...$args);
    }

    /**
     * Sets $_FILES
     *
     * @param *array $data
     * @param mixed  ...$args
     *
     * @return FileTrait
     */
    public function setFiles($data, ...$args)
    {
        if (is_array($data)) {
            return $this->set('files', $data);
        }

        if (count($args) === 0) {
            return $this;
        }

        return $this->set('files', $data, ...$args);
    }
}
{'fraction_non_alphanumeric': 0.15627965833596963, 'fraction_numerical': 0.006327111673521037, 'mean_word_length': 1.7305699481865284, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 21, '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': '6621623', 'n_tokens_mistral': 1027, 'n_tokens_neox': 988, 'n_words': 281}