<commit_before><?php

/**
 * This file is part of Satis.
 *
 * (c) <NAME> <<EMAIL>>
 *     <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace Composer\Satis\Builder;

use Composer\Composer;
use Composer\Repository\ComposerRepository;
use Composer\Package\Link;
use Composer\Package\LinkConstraint\MultiConstraint;
use Composer\Package\AliasPackage;
use Composer\Package\BasePackage;
use Composer\Repository\PlatformRepository;
use Composer\Package\Loader\ArrayLoader;
use Composer\Package\Dumper\ArrayDumper;
use Composer\DependencyResolver\Pool;
use Composer\Json\JsonFile;
use Symfony\Component\Console\Output\OutputInterface;

/**
 * Builds the JSON stuff.
 *
 * @author <NAME> <<EMAIL>>
 */
class PackagesBuilder extends Builder implements BuilderInterface
{
    /** @var string prefix of included json files. */
    private $filenamePrefix;

    /** @var string packages.json file name. */
    private $filename;

    /**
     * Dedicated Packages Constructor.
     *
     * @param OutputInterface $output    The output Interface
     * @param string          $outputDir The directory where to build
     * @param array           $config    The parameters from ./satis.json
     */
    public function __construct(OutputInterface $output, $outputDir, $config)
    {
        parent::__construct($output, $outputDir, $config);

        $this->filenamePrefix = $this->outputDir.'/include/all';
        $this->filename = $this->outputDir.'/packages.json';
    }

    /**
     * Sets the list of packages to build.
     *
     * @param Composer $composer       The Composer instance
     * @param bool     $verbose        Output infos is true
     * @param bool     $skipErrors     Escapes Exceptions if true
     * @param array    $packagesFilter The active package filter to merge
     *
     * @return array list of packages to build
     */
    public function select(Composer $composer, $verbose, $skipErrors, array $packagesFilter = array())
    {
        $selected = array();

        // fetch options
        $requireAll = isset($this->config['require-all']) && true === $this->config['require-all'];
        $requireDependencies = isset($this->config['require-dependencies']) && true === $this->config['require-dependencies'];
        $requireDevDependencies = isset($this->config['require-dev-dependencies']) && true === $this->config['require-dev-dependencies'];

        if (!$requireAll && !isset($config['require'])) {
            $output->writeln('No explicit requires defined, enabling require-all');
            $requireAll = true;
        }

        $minimumStability = isset($this->config['minimum-stability']) ? $this->config['minimum-stability'] : 'dev';

        // run over all packages and store matching ones
        $this->output->writeln('<info>Scanning packages</info>');

        $repos = $composer->getRepositoryManager()->getRepositories();
        $pool = new Pool($minimumStability);<commit_msg>fix properties usage<commit_after><?php

/**
 * This file is part of Satis.
 *
 * (c) <NAME> <<EMAIL>>
 *     <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace Composer\Satis\Builder;

use Composer\Composer;
use Composer\Repository\ComposerRepository;
use Composer\Package\Link;
use Composer\Package\LinkConstraint\MultiConstraint;
use Composer\Package\AliasPackage;
use Composer\Package\BasePackage;
use Composer\Repository\PlatformRepository;
use Composer\Package\Loader\ArrayLoader;
use Composer\Package\Dumper\ArrayDumper;
use Composer\DependencyResolver\Pool;
use Composer\Json\JsonFile;
use Symfony\Component\Console\Output\OutputInterface;

/**
 * Builds the JSON stuff.
 *
 * @author <NAME> <<EMAIL>>
 */
class PackagesBuilder extends Builder implements BuilderInterface
{
    /** @var string prefix of included json files. */
    private $filenamePrefix;

    /** @var string packages.json file name. */
    private $filename;

    /**
     * Dedicated Packages Constructor.
     *
     * @param OutputInterface $output    The output Interface
     * @param string          $outputDir The directory where to build
     * @param array           $config    The parameters from ./satis.json
     */
    public function __construct(OutputInterface $output, $outputDir, $config)
    {
        parent::__construct($output, $outputDir, $config);

        $this->filenamePrefix = $this->outputDir.'/include/all';
        $this->filename = $this->outputDir.'/packages.json';
    }

    /**
     * Sets the list of packages to build.
     *
     * @param Composer $composer       The Composer instance
     * @param bool     $verbose        Output infos is true
     * @param bool     $skipErrors     Escapes Exceptions if true
     * @param array    $packagesFilter The active package filter to merge
     *
     * @return array list of packages to build
     */
    public function select(Composer $composer, $verbose, $skipErrors, array $packagesFilter = array())
    {
        $selected = array();

        // fetch options
        $requireAll = isset($this->config['require-all']) && true === $this->config['require-all'];
        $requireDependencies = isset($this->config['require-dependencies']) && true === $this->config['require-dependencies'];
        $requireDevDependencies = isset($this->config['require-dev-dependencies']) && true === $this->config['require-dev-dependencies'];

        if (!$requireAll && !isset($this->config['require'])) {
            $this->output->writeln('No explicit requires defined, enabling require-all');
            $requireAll = true;
        }

        $minimumStability = isset($this->config['minimum-stability']) ? $this->config['minimum-stability'] : 'dev';

        // run over all packages and store matching ones
        $this->output->writeln('<info>Scanning packages</info>');

        $repos = $composer->getRepositoryManager()->getRepositories();
        $pool = new Pool($minimumStability);
{'fraction_non_alphanumeric': 0.12863002461033635, 'fraction_numerical': 0.0, 'mean_word_length': 3.2245322245322243, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 61, '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': '7581164', 'n_tokens_mistral': 1653, 'n_tokens_neox': 1620, 'n_words': 443}