<commit_before><?php

namespace Ems\Testing;

use ReflectionProperty;
use ReflectionMethod;

/**
 * This class allows to get protected and private values from classes
 * and allows to call private and protected methods.
 * So you can test your classes without adding artificial public methods
 * just to test them.
 **/
class Cheat
{
    /**
     * Get the value of a property, even if it is protected or private.
     *
     * @param object $object
     * @param string $property
     *
     * @return mixed
     **/
    public static function get($object, $property)
    {
        $reflection = new ReflectionProperty($object, $property);
        $reflection->setAccessible(true);

        return $reflection->getValue($object);
    }

    /**
     * Set the value of a property, even if it is protected or private.
     *
     * @param object $object
     * @param string $property
     * @param mixed  $value
     *
     * @return void
     **/
    public function set($object, $property, $value)<commit_msg>Make static set method static...<commit_after><?php

namespace Ems\Testing;

use ReflectionProperty;
use ReflectionMethod;

/**
 * This class allows to get protected and private values from classes
 * and allows to call private and protected methods.
 * So you can test your classes without adding artificial public methods
 * just to test them.
 **/
class Cheat
{
    /**
     * Get the value of a property, even if it is protected or private.
     *
     * @param object $object
     * @param string $property
     *
     * @return mixed
     **/
    public static function get($object, $property)
    {
        $reflection = new ReflectionProperty($object, $property);
        $reflection->setAccessible(true);

        return $reflection->getValue($object);
    }

    /**
     * Set the value of a property, even if it is protected or private.
     *
     * @param object $object
     * @param string $property
     * @param mixed  $value
     *
     * @return void
     **/
    public static function set($object, $property, $value)
{'fraction_non_alphanumeric': 0.09707317073170732, 'fraction_numerical': 0.0, 'mean_word_length': 2.630088495575221, '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': '3276372', 'n_tokens_mistral': 555, 'n_tokens_neox': 551, 'n_words': 214}