<commit_before><?php

namespace Doctrine\Tests\Models\Company;

class CompanyContractListener
{
    const PRE_PERSIST = 0;

    public $postPersistCalls;
    public $prePersistCalls;

    public $postUpdateCalls;
    public $preUpdateCalls;

    public $postRemoveCalls;
    public $preRemoveCalls;

    public $preFlushCalls;

    public $postLoadCalls;

    public $snapshots = [];

    /**
     * @PostPersist
     */
    public function postPersistHandler(CompanyContract $contract)
    {
        $this->postPersistCalls[] = func_get_args();
    }

    /**
     * @PrePersist
     */
    public function prePersistHandler(CompanyContract $contract)
    {
        $this->snapshots[self::PRE_PERSIST][] = $this->takeSnapshot($contract);
        $this->prePersistCalls[] = func_get_args();
    }

    /**
     * @PostUpdate
     */
    public function postUpdateHandler(CompanyContract $contract)
    {
        $this->postUpdateCalls[] = func_get_args();
    }

    /**
     * @PreUpdate
     */
    public function preUpdateHandler(CompanyContract $contract)
    {
        $this->preUpdateCalls[] = func_get_args();
    }

    /**
     * @PostRemove
     */
    public function postRemoveHandler(CompanyContract $contract)
    {
        $this->postRemoveCalls[] = func_get_args();
    }

    /**
     * @PreRemove
     */
    public function preRemoveHandler(CompanyContract $contract)
    {
        $this->preRemoveCalls[] = func_get_args();
    }

    /**
     * @PreFlush
     */
    public function preFlushHandler(CompanyContract $contract)
    {
        $this->preFlushCalls[] = func_get_args();
    }

    /**
     * @PostLoad
     */
    public function postLoadHandler(CompanyContract $contract)
    {
        $this->postLoadCalls[] = func_get_args();
    }

    public function takeSnapshot(CompanyContract $contract)
    {
        $snapshot = [];

        foreach ((new \ReflectionClass($contract))->getProperties() as $property) {
            $property->setAccessible(true);

            $value = $property->getValue($contract);

            if (is_object($value) || is_array($value)) {
                continue;
            }

            $snapshot[$property->getName()] = $property->getValue($contract);
        }

        return $snapshot;
    }
}<commit_msg>#6174 #5570 removed modifications applied to the `CompanyContractListener`, since `UnitOfWorkTest` now completely encapsulates the scenarios being covered<commit_after><?php

namespace Doctrine\Tests\Models\Company;

class CompanyContractListener
{
    public $postPersistCalls;
    public $prePersistCalls;

    public $postUpdateCalls;
    public $preUpdateCalls;

    public $postRemoveCalls;
    public $preRemoveCalls;

    public $preFlushCalls;

    public $postLoadCalls;

    /**
     * @PostPersist
     */
    public function postPersistHandler(CompanyContract $contract)
    {
        $this->postPersistCalls[] = func_get_args();
    }

    /**
     * @PrePersist
     */
    public function prePersistHandler(CompanyContract $contract)
    {
        $this->prePersistCalls[] = func_get_args();
    }

    /**
     * @PostUpdate
     */
    public function postUpdateHandler(CompanyContract $contract)
    {
        $this->postUpdateCalls[] = func_get_args();
    }

    /**
     * @PreUpdate
     */
    public function preUpdateHandler(CompanyContract $contract)
    {
        $this->preUpdateCalls[] = func_get_args();
    }

    /**
     * @PostRemove
     */
    public function postRemoveHandler(CompanyContract $contract)
    {
        $this->postRemoveCalls[] = func_get_args();
    }

    /**
     * @PreRemove
     */
    public function preRemoveHandler(CompanyContract $contract)
    {
        $this->preRemoveCalls[] = func_get_args();
    }

    /**
     * @PreFlush
     */
    public function preFlushHandler(CompanyContract $contract)
    {
        $this->preFlushCalls[] = func_get_args();
    }

    /**
     * @PostLoad
     */
    public function postLoadHandler(CompanyContract $contract)
    {
        $this->postLoadCalls[] = func_get_args();
    }
}
{'fraction_non_alphanumeric': 0.12112259970457903, 'fraction_numerical': 0.0022156573116691287, 'mean_word_length': 2.520797227036395, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 26, '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': '3019266', 'n_tokens_mistral': 1232, 'n_tokens_neox': 1196, 'n_words': 198}