<commit_before><?php
/**
 * This file is part of the Axstrad library.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 *
 * @copyright 2014-2015 <NAME> <<EMAIL>>
 */

namespace Axstrad\Component\Content\Traits;


use Axstrad\Component\Content\Exception\InvalidArgumentException;

/**
 * Axstrad\Component\Content\Traits\Copy
 *
 * @author <NAME> <<EMAIL>>
 * @license MIT
 * @package Axstrad/Content
 */
trait Copy
{
    /**
     * @var string $copy The copy
     */
    protected $copy;


    /**
     * Set Copy
     *
     * @param string $copy
     * @return self
     */
    public function setCopy($copy = null)
    {
        if (is_null($copy)) {
            $this->copy = null;
        }
        elseif (!is_scalar($copy)) {
            throw InvalidArgumentException::create(
                'string (or scalar)',
                $copy
            );
        }
        else {
            $this->copy = (string) $copy;
        }
        return $this;
    }<commit_msg>Document that Copy::$copy can be set to null<commit_after><?php
/**
 * This file is part of the Axstrad library.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 *
 * @copyright 2014-2015 <NAME> <<EMAIL>>
 */

namespace Axstrad\Component\Content\Traits;


use Axstrad\Component\Content\Exception\InvalidArgumentException;

/**
 * Axstrad\Component\Content\Traits\Copy
 *
 * @author <NAME> <<EMAIL>>
 * @license MIT
 * @package Axstrad/Content
 */
trait Copy
{
    /**
     * @var null|string $copy The copy
     */
    protected $copy;


    /**
     * Set Copy
     *
     * @param string $copy
     * @return self
     */
    public function setCopy($copy = null)
    {
        if (is_null($copy)) {
            $this->copy = null;
        }
        elseif (!is_scalar($copy)) {
            throw InvalidArgumentException::create(
                'string (or scalar)',
                $copy
            );
        }
        else {
            $this->copy = (string) $copy;
        }
        return $this;
    }
{'fraction_non_alphanumeric': 0.13055303717135086, 'fraction_numerical': 0.007252946509519492, 'mean_word_length': 1.9986413043478262, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 25, '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': '7270537', 'n_tokens_mistral': 674, 'n_tokens_neox': 653, 'n_words': 177}