<commit_before><?php

namespace Bolt\Composer\Action;

use Composer\Installer;

/**
 * Composer update package class
 *
 * @author <NAME> <<EMAIL>>
 */
class UpdatePackage
{
    /**
     * @var array
     */
    private $options;

    /**
     * @var Composer\IO\BufferIO
     */
    private $io;

    /**
     * @var Composer\Composer
     */
    private $composer;

    /**
     * @param $io       Composer\IO\BufferIO
     * @param $composer Composer\Composer
     * @param $options  array
     */
    public function __construct(\Composer\IO\BufferIO $io, \Composer\Composer $composer, array $options)
    {
        $this->options = $options;
        $this->io = $io;
        $this->composer = $composer;
    }

    /**
     * Update packages
     *
     * @param  $packages array Indexed array of package names to remove
     * @return integer 0 on success or a positive error code on failure
     */
    public function execute(array $packages = array())
    {
        $install = Installer::create($this->io, $this->composer);
        $config = $this->composer->getConfig();
        $optimize = $config->get('optimize-autoloader');

        $preferSource = false; // Forces installation from package sources when possible, including VCS information.
        $preferDist = true;

        switch ($config->get('preferred-install')) {
            case 'source':
                $preferSource = true;
                break;
            case 'dist':
                $preferDist = true;
                break;
            case 'auto':
            default:
                break;<commit_msg>Handle passed in options in UpdatePackage<commit_after><?php

namespace Bolt\Composer\Action;

use Bolt\Helpers\Arr;
use Composer\Installer;

/**
 * Composer update package class
 *
 * @author <NAME> <<EMAIL>>
 */
class UpdatePackage
{
    /**
     * @var array
     */
    private $options;

    /**
     * @var Composer\IO\BufferIO
     */
    private $io;

    /**
     * @var Composer\Composer
     */
    private $composer;

    /**
     * @param $io       Composer\IO\BufferIO
     * @param $composer Composer\Composer
     * @param $options  array
     */
    public function __construct(\Composer\IO\BufferIO $io, \Composer\Composer $composer, array $options)
    {
        $this->options = $options;
        $this->io = $io;
        $this->composer = $composer;
    }

    /**
     * Update packages
     *
     * @param  $packages array Indexed array of package names to remove
     * @param  $options  array [Optional] changed option set
     * @return integer 0 on success or a positive error code on failure
     */
    public function execute(array $packages = array(), array $options = null)
    {
        // Handle passed in options
        if (!is_null($options)) {
            $options = Arr::mergeRecursiveDistinct($this->options, $options);
        }

        $install = Installer::create($this->io, $this->composer);
        $config = $this->composer->getConfig();
        $optimize = $config->get('optimize-autoloader');

        $preferSource = false; // Forces installation from package sources when possible, including VCS information.
        $preferDist = true;

        switch ($config->get('preferred-install')) {
            case 'source':
                $preferSource = true;
                break;
            case 'dist':
                $preferDist = true;
                break;
            case 'auto':
            default:
                break;
{'fraction_non_alphanumeric': 0.12410020155485171, 'fraction_numerical': 0.0005758710048949035, 'mean_word_length': 1.9692307692307693, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 28, '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': '5884474', 'n_tokens_mistral': 1005, 'n_tokens_neox': 982, 'n_words': 255}