<commit_before><?php

namespace Honeybee\Projection\EventHandler;

use Exception;
use Honeybee\Common\Error\RuntimeError;
use Honeybee\Common\Error\FilesystemError;
use Honeybee\EntityTypeInterface;
use Honeybee\Infrastructure\Config\ConfigInterface;
use Honeybee\Infrastructure\Event\EventHandler;
use Honeybee\Infrastructure\Filesystem\FilesystemServiceInterface;
use Honeybee\Model\Aggregate\AggregateRootTypeMap;
use Honeybee\Model\Event\AggregateRootEventInterface;
use Honeybee\Model\Event\HasEmbeddedEntityEventsInterface;
use Honeybee\Model\Task\CreateAggregateRoot\AggregateRootCreatedEvent;
use Honeybee\Model\Task\ModifyAggregateRoot\AggregateRootModifiedEvent;
use Honeybee\Model\Task\ProceedWorkflow\WorkflowProceededEvent;
use Psr\Log\LoggerInterface;
use Trellis\Runtime\Attribute\HandlesFileInterface;
use Trellis\Runtime\Attribute\HandlesFileListInterface;

class ProjectionFileHandler extends EventHandler
{
    protected $aggregate_root_type_map;

    protected $filesystem_service;

    public function __construct(
        ConfigInterface $config,
        LoggerInterface $logger,
        AggregateRootTypeMap $aggregate_root_type_map,
        FilesystemServiceInterface $filesystem_service
    ) {
        parent::__construct($config, $logger);

        $this->aggregate_root_type_map = $aggregate_root_type_map;
        $this->filesystem_service = $filesystem_service;
    }

    protected function onAggregateRootCreated(AggregateRootCreatedEvent $event)
    {
        $ar_type = $this->aggregate_root_type_map->getByClassName($event->getAggregateRootType());
        $this->moveTempFilesToFinalLocation($event, $ar_type);
    }

    protected function onAggregateRootModified(AggregateRootModifiedEvent $event)
    {
        $ar_type = $this->aggregate_root_type_map->getByClassName($event->getAggregateRootType());
        $this->moveTempFilesToFinalLocation($event, $ar_type);
    }
<commit_msg>events now have AR prefixes instead of classnames<commit_after><?php

namespace Honeybee\Projection\EventHandler;

use Exception;
use Honeybee\Common\Error\RuntimeError;
use Honeybee\Common\Error\FilesystemError;
use Honeybee\EntityTypeInterface;
use Honeybee\Infrastructure\Config\ConfigInterface;
use Honeybee\Infrastructure\Event\EventHandler;
use Honeybee\Infrastructure\Filesystem\FilesystemServiceInterface;
use Honeybee\Model\Aggregate\AggregateRootTypeMap;
use Honeybee\Model\Event\AggregateRootEventInterface;
use Honeybee\Model\Event\HasEmbeddedEntityEventsInterface;
use Honeybee\Model\Task\CreateAggregateRoot\AggregateRootCreatedEvent;
use Honeybee\Model\Task\ModifyAggregateRoot\AggregateRootModifiedEvent;
use Honeybee\Model\Task\ProceedWorkflow\WorkflowProceededEvent;
use Psr\Log\LoggerInterface;
use Trellis\Runtime\Attribute\HandlesFileInterface;
use Trellis\Runtime\Attribute\HandlesFileListInterface;

class ProjectionFileHandler extends EventHandler
{
    protected $aggregate_root_type_map;

    protected $filesystem_service;

    public function __construct(
        ConfigInterface $config,
        LoggerInterface $logger,
        AggregateRootTypeMap $aggregate_root_type_map,
        FilesystemServiceInterface $filesystem_service
    ) {
        parent::__construct($config, $logger);

        $this->aggregate_root_type_map = $aggregate_root_type_map;
        $this->filesystem_service = $filesystem_service;
    }

    protected function onAggregateRootCreated(AggregateRootCreatedEvent $event)
    {
        $ar_type = $this->aggregate_root_type_map->getItem($event->getAggregateRootType());
        $this->moveTempFilesToFinalLocation($event, $ar_type);
    }

    protected function onAggregateRootModified(AggregateRootModifiedEvent $event)
    {
        $ar_type = $this->aggregate_root_type_map->getItem($event->getAggregateRootType());
        $this->moveTempFilesToFinalLocation($event, $ar_type);
    }

{'fraction_non_alphanumeric': 0.08432488360062079, 'fraction_numerical': 0.0, 'mean_word_length': 5.690311418685121, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 23, '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': '5103099', 'n_tokens_mistral': 1140, 'n_tokens_neox': 1121, 'n_words': 159}