<commit_before><?php

namespace atk4\core;

trait FactoryTrait
{
    /**
     * Check this property to see if trait is present in the object.
     *
     * @var bool
     */
    public $_factoryTrait = true;

    /**
     * Creates and returns new object.
     * If object is passed as $object parameter, then same object is returned.
     *
     * @param mixed $object
     * @param array $defaults
     *
     * @return object
     */
    public function factory($object, $defaults = [])
    {
        if (is_object($object)) {
            foreach ($defaults as $key=>$value) {
                $object->$key = $value;
            }

            return $object;
        }
<commit_msg>fix factory() properties<commit_after><?php

namespace atk4\core;

trait FactoryTrait
{
    /**
     * Check this property to see if trait is present in the object.
     *
     * @var bool
     */
    public $_factoryTrait = true;

    /**
     * Creates and returns new object.
     * If object is passed as $object parameter, then same object is returned.
     *
     * @param mixed $object
     * @param array $defaults
     *
     * @return object
     */
    public function factory($object, $defaults = [])
    {
        if (is_object($object)) {
            foreach ($defaults as $key=>$value) {
                if ($value !== null) {
                    $object->$key = $value;
                }
            }

            return $object;
        }

{'fraction_non_alphanumeric': 0.11234396671289876, 'fraction_numerical': 0.0013869625520110957, 'mean_word_length': 1.687150837988827, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '1162551', 'n_tokens_mistral': 408, 'n_tokens_neox': 403, 'n_words': 127}