<commit_before><?php

namespace Rootcanal;

use Symfony\Component\Filesystem\Filesystem;
use Rootcanal\Config\Config;
use Rootcanal\Config\Finder;
use Composer\Installer\InstallationManager;
use Composer\Repository\RepositoryManager;

class Mapper
{
    /*
     * @param Filesystem $fs
     */
    private $fs;

    /*
     * @param Config $config
     */
    private $config;

    /*
     * @param Finder $finder
     */
    private $finder;

    /*
     * @param InstallationManager $im
     */
    private $im;

    /*
     * @param RepositoryManager $rm
     */
    private $rm;

    public function __construct(
        Config $config,
        Finder $finder,
        InstallationManager $im,
        RepositoryManager $rm
    )
    {
        $this->config = $config;
        $this->finder = $finder;
        $this->im = $im;
        $this->rm = $rm;
    }

    public function getFS()
    {
        return $this->fs ? $this->fs : $this->fs = new Filesystem();
    }

    protected function getPackages()
    {
        return $this->rm->getLocalRepository()->getCanonicalPackages();
    }

    /**
     * @param Composer\Package\CompletePackage Instance
     */
    protected function getInstallPath($package)
    {
        return $this->im
            ->getInstaller($package->getType())
            ->getInstallPath($package);
    }

    public function getMap()
    {
        return array_merge(
            $this->mapContrib(),
            $this->mapCustomByType('module'),
            $this->mapCustomByType('theme'),
            $this->mapCustomFiles(),
            $this->mapSettings(),
            $this->mapFiles()
        );
    }

    public function clear()
    {
        $this->getFS()
            ->remove(['directory', $this->config->getPathsByType('core')]);
    }

    public function mapFiles()<commit_msg>Adding vendor to the map.<commit_after><?php

namespace Rootcanal;

use Symfony\Component\Filesystem\Filesystem;
use Rootcanal\Config\Config;
use Rootcanal\Config\Finder;
use Composer\Installer\InstallationManager;
use Composer\Repository\RepositoryManager;

class Mapper
{
    /*
     * @param Filesystem $fs
     */
    private $fs;

    /*
     * @param Config $config
     */
    private $config;

    /*
     * @param Finder $finder
     */
    private $finder;

    /*
     * @param InstallationManager $im
     */
    private $im;

    /*
     * @param RepositoryManager $rm
     */
    private $rm;

    public function __construct(
        Config $config,
        Finder $finder,
        InstallationManager $im,
        RepositoryManager $rm
    )
    {
        $this->config = $config;
        $this->finder = $finder;
        $this->im = $im;
        $this->rm = $rm;
    }

    public function getFS()
    {
        return $this->fs ? $this->fs : $this->fs = new Filesystem();
    }

    protected function getPackages()
    {
        return $this->rm->getLocalRepository()->getCanonicalPackages();
    }

    /**
     * @param Composer\Package\CompletePackage Instance
     */
    protected function getInstallPath($package)
    {
        return $this->im
            ->getInstaller($package->getType())
            ->getInstallPath($package);
    }

    public function getMap()
    {
        return array_merge(
            $this->mapContrib(),
            $this->mapCustomByType('module'),
            $this->mapCustomByType('theme'),
            $this->mapCustomFiles(),
            $this->mapVendor(),
            $this->mapSettings(),
            $this->mapFiles()
        );
    }

    public function clear()
    {
        $this->getFS()
            ->remove(['directory', $this->config->getPathsByType('core')]);
    }

    public function mapFiles()
{'fraction_non_alphanumeric': 0.13479200432198812, 'fraction_numerical': 0.0, 'mean_word_length': 1.9911147011308563, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 52, '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': '5183442', 'n_tokens_mistral': 1089, 'n_tokens_neox': 1071, 'n_words': 210}