<commit_before><?php

namespace Benchmap\Task;

use Benchmap\Domain\User;
use Benchmap\Domain\UserDTO;
use Benchmap\TaskInterface;
use Jane\AutoMapper\AutoMapper;
use Jane\AutoMapper\Compiler\Accessor;
use Jane\AutoMapper\Compiler\Compiler;
use Jane\AutoMapper\Compiler\SourceTargetPropertiesMappingExtractor;
use Jane\AutoMapper\Compiler\Transformer\TransformerFactory;
use Jane\AutoMapper\MapperConfiguration;
use Symfony\Component\PropertyInfo\Extractor\PhpDocExtractor;
use Symfony\Component\PropertyInfo\Extractor\ReflectionExtractor;
use Symfony\Component\PropertyInfo\PropertyInfoExtractor;

class JaneAutoMapperOptimizedTask implements TaskInterface
{
    private $mapper;

    public function __construct()
    {
        $mappingExtractor = new SourceTargetPropertiesMappingExtractor(new PropertyInfoExtractor(
            [new ReflectionExtractor()],
            [new ReflectionExtractor(), new PhpDocExtractor()],
            [new ReflectionExtractor()],
            [new ReflectionExtractor()]
        ), new Accessor\ReflectionAccessorExtractor(), new TransformerFactory());
        $autoMapper = new AutoMapper();
        // We assume that we get the mapper directly and that it has been previously writed to disk (so compile time is not included here)
        $autoMapper->register(new MapperConfiguration($mappingExtractor, User::class, UserDTO::class));
        $this->mapper = $autoMapper->getMapper(User::class, UserDTO::class);
    }

    public function getName()
    {
        return 'jane-php/automapper (optimized)';
    }

    public function prepare()
    {
    }

    public function run(array $sources)
    {
        foreach ($sources as $source) {
            $this->mapper->map($source);
        }
    }

    public function isValid()
    {
       return true;
    }
}<commit_msg>Fix error on Jane AutoMapper optimized task<commit_after><?php

namespace Benchmap\Task;

use Benchmap\Domain\User;
use Benchmap\Domain\UserDTO;
use Benchmap\TaskInterface;
use Jane\AutoMapper\AutoMapper;
use Jane\AutoMapper\Compiler\Accessor;
use Jane\AutoMapper\Compiler\Compiler;
use Jane\AutoMapper\Compiler\SourceTargetPropertiesMappingExtractor;
use Jane\AutoMapper\Compiler\Transformer\TransformerFactory;
use Jane\AutoMapper\Context;
use Jane\AutoMapper\MapperConfiguration;
use Symfony\Component\PropertyInfo\Extractor\PhpDocExtractor;
use Symfony\Component\PropertyInfo\Extractor\ReflectionExtractor;
use Symfony\Component\PropertyInfo\PropertyInfoExtractor;

class JaneAutoMapperOptimizedTask implements TaskInterface
{
    private $mapper;

    public function __construct()
    {
        $mappingExtractor = new SourceTargetPropertiesMappingExtractor(new PropertyInfoExtractor(
            [new ReflectionExtractor()],
            [new ReflectionExtractor(), new PhpDocExtractor()],
            [new ReflectionExtractor()],
            [new ReflectionExtractor()]
        ), new Accessor\ReflectionAccessorExtractor(), new TransformerFactory());
        $autoMapper = new AutoMapper();
        // We assume that we get the mapper directly and that it has been previously writed to disk (so compile time is not included here)
        $autoMapper->register(new MapperConfiguration($mappingExtractor, User::class, UserDTO::class));
        $this->mapper = $autoMapper->getMapper(User::class, UserDTO::class);
    }

    public function getName()
    {
        return 'jane-php/automapper (optimized)';
    }

    public function prepare()
    {
    }

    public function run(array $sources)
    {
        foreach ($sources as $source) {
            $this->mapper->map($source, new Context());
        }
    }

    public function isValid()
    {
       return true;
    }
}

{'fraction_non_alphanumeric': 0.09634641407307172, 'fraction_numerical': 0.0, 'mean_word_length': 3.7263427109974425, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, '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': '1881911', 'n_tokens_mistral': 1006, 'n_tokens_neox': 993, 'n_words': 232}