<commit_before><?php

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

namespace Gnugat\Bundle\WizardBundle\EventListener;

use Composer\Package\PackageInterface;
use Composer\Script\Event;

use Gnugat\Bundle\WizardBundle\DependencyInjection\Factory;

/**
 * Controller which:
 * - takes composer's events as input
 * - returns nothing as output
 *
 * @author <NAME> <<EMAIL>>
 */
class ComposerListener
{
    /**
     * On Composer's "post-package-install" event, register the package.
     *
     * @param Event $event
     */
    public static function registerPackage(Event $event)
    {
        $installedPackage = $event->getOperation()->getPackage();

        if (!self::isBundle($installedPackage)) {
            return;
        }

        self::enablePackage($installedPackage);
    }

    /**
     * Checks if the given package is a Symfony bundle.
     *
     * @param PackageInterface $package
     *
     * @return bool
     */
    public static function isBundle(PackageInterface $package)
    {
        return 'symfony-bundle' === $package->getType();
    }

    /**
     * @param string      $consoleInput
     * @param IOInterface $consoleOutput
     *
     * @throws \RuntimeException If an error occured during the running
     */
    public static function enablePackage(PackageInterface $package)
    {
        $packageRepository = Factory::makePackageRepository($package);
        $bundleFactory = Factory::makeBundleFactory();
        $kernelManipulator = Factory::makeKernelManipulator();

        $composerPackage = $packageRepository->findOneByName($package->getName());
        $bundle = $bundleFactory->make($composerPackage->namespace);

        $kernelManipulator->addBundle($bundle->fullyQualifiedClassname)
    }
}<commit_msg>[Fix] Fixed syntax error<commit_after><?php

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

namespace Gnugat\Bundle\WizardBundle\EventListener;

use Composer\Package\PackageInterface;
use Composer\Script\Event;

use Gnugat\Bundle\WizardBundle\DependencyInjection\Factory;

/**
 * Controller which:
 * - takes composer's events as input
 * - returns nothing as output
 *
 * @author <NAME> <<EMAIL>>
 */
class ComposerListener
{
    /**
     * On Composer's "post-package-install" event, register the package.
     *
     * @param Event $event
     */
    public static function registerPackage(Event $event)
    {
        $installedPackage = $event->getOperation()->getPackage();

        if (!self::isBundle($installedPackage)) {
            return;
        }

        self::enablePackage($installedPackage);
    }

    /**
     * Checks if the given package is a Symfony bundle.
     *
     * @param PackageInterface $package
     *
     * @return bool
     */
    public static function isBundle(PackageInterface $package)
    {
        return 'symfony-bundle' === $package->getType();
    }

    /**
     * @param string      $consoleInput
     * @param IOInterface $consoleOutput
     *
     * @throws \RuntimeException If an error occured during the running
     */
    public static function enablePackage(PackageInterface $package)
    {
        $packageRepository = Factory::makePackageRepository($package);
        $bundleFactory = Factory::makeBundleFactory();
        $kernelManipulator = Factory::makeKernelManipulator();

        $composerPackage = $packageRepository->findOneByName($package->getName());
        $bundle = $bundleFactory->make($composerPackage->namespace);

        $kernelManipulator->addBundle($bundle->fullyQualifiedClassname);
    }
}
{'fraction_non_alphanumeric': 0.11441115702479339, 'fraction_numerical': 0.0, 'mean_word_length': 3.0854430379746836, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 33, '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': '4208430', 'n_tokens_mistral': 1055, 'n_tokens_neox': 1029, 'n_words': 261}