<commit_before><?php
namespace AnhNhan\Converge\Modules\Task\Transaction;

use AnhNhan\Converge\Modules\Task\Storage\TaskTransaction;
use AnhNhan\Converge\Storage\Transaction\TransactionEntity;
use AnhNhan\Converge\Storage\Transaction\TransactionEditor;

/**
 * @author <NAME> <<EMAIL>>
 */
final class TaskEditor extends TransactionEditor
{
    public function getTransactionTypes()
    {
        $types = parent::getTransactionTypes();

        $types[] = TaskTransaction::TYPE_EDIT_LABEL;
        $types[] = TaskTransaction::TYPE_EDIT_ASSIGN;
        $types[] = TaskTransaction::TYPE_EDIT_DESC;
        $types[] = TaskTransaction::TYPE_EDIT_STATUS;
        $types[] = TaskTransaction::TYPE_EDIT_PRIORITY;
        $types[] = TaskTransaction::TYPE_EDIT_COMPLETED;

        return $types;
    }

    protected function getCustomTransactionOldValue($entity, TransactionEntity $transaction)
    {
        switch ($transaction->type()) {
            case TransactionEntity::TYPE_CREATE:
                return null;
            case TaskTransaction::TYPE_EDIT_DESC:
                return $entity->description();
            case TaskTransaction::TYPE_EDIT_ASSIGN:
                return $entity->assignedId();
            case TaskTransaction::TYPE_EDIT_LABEL:
                return $entity->label();
            case TaskTransaction::TYPE_EDIT_STATUS:
                return $entity->status();
            case TaskTransaction::TYPE_EDIT_PRIORITY:
                return $entity->priority();
            case TaskTransaction::TYPE_EDIT_COMPLETED:
                return $entity->completed();<commit_msg>Fixing TaskEditor bug where objects would end up in the storage<commit_after><?php
namespace AnhNhan\Converge\Modules\Task\Transaction;

use AnhNhan\Converge\Modules\Task\Storage\TaskTransaction;
use AnhNhan\Converge\Storage\Transaction\TransactionEntity;
use AnhNhan\Converge\Storage\Transaction\TransactionEditor;

/**
 * @author <NAME> <<EMAIL>>
 */
final class TaskEditor extends TransactionEditor
{
    public function getTransactionTypes()
    {
        $types = parent::getTransactionTypes();

        $types[] = TaskTransaction::TYPE_EDIT_LABEL;
        $types[] = TaskTransaction::TYPE_EDIT_ASSIGN;
        $types[] = TaskTransaction::TYPE_EDIT_DESC;
        $types[] = TaskTransaction::TYPE_EDIT_STATUS;
        $types[] = TaskTransaction::TYPE_EDIT_PRIORITY;
        $types[] = TaskTransaction::TYPE_EDIT_COMPLETED;

        return $types;
    }

    protected function getCustomTransactionOldValue($entity, TransactionEntity $transaction)
    {
        switch ($transaction->type()) {
            case TransactionEntity::TYPE_CREATE:
                return null;
            case TaskTransaction::TYPE_EDIT_DESC:
                return $entity->description();
            case TaskTransaction::TYPE_EDIT_ASSIGN:
                return $entity->assignedId();
            case TaskTransaction::TYPE_EDIT_LABEL:
                return $entity->label();
            case TaskTransaction::TYPE_EDIT_STATUS:
                return $entity->status()->uid;
            case TaskTransaction::TYPE_EDIT_PRIORITY:
                return $entity->priority()->uid;
            case TaskTransaction::TYPE_EDIT_COMPLETED:
                return $entity->completed();
{'fraction_non_alphanumeric': 0.10349050826699327, 'fraction_numerical': 0.0, 'mean_word_length': 2.96, 'pattern_counts': {'":': 0, '<': 11, '<?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': '4497996', 'n_tokens_mistral': 851, 'n_tokens_neox': 842, 'n_words': 151}