<commit_before><?php

declare(strict_types=1);

/**
 * Copyright (c) 2013-2017 OpenCFP
 *
 * For the full copyright and license information, please view
 * the LICENSE file that was distributed with this source code.
 *
 * @see https://github.com/opencfp/opencfp
 */

namespace OpenCFP\Provider\Gateways;

use OpenCFP\Console\Application;
use OpenCFP\Console\Command\ClearCacheCommand;
use OpenCFP\Console\Command\UserCreateCommand;
use OpenCFP\Console\Command\UserDemoteCommand;
use OpenCFP\Console\Command\UserPromoteCommand;
use OpenCFP\Domain\Services\AccountManagement;
use OpenCFP\Path;
use Pimple\Container;
use Pimple\ServiceProviderInterface;

final class ConsoleGatewayProvider implements ServiceProviderInterface
{
    public function register(Container $app)
    {
        $app[ClearCacheCommand::class] = function ($app) {
            /** @var Path $path */
            $path = $app['path'];

            return new ClearCacheCommand([
                $path->cachePurifierPath(),
                $path->cacheTwigPath(),
            ]);
        };

        $app[UserCreateCommand::class] = function ($app) {
            return new UserCreateCommand(
                $app[AccountManagement::class]
            );
        };

        $app[UserDemoteCommand::class] = function ($app) {
            return new UserDemoteCommand(
                $app[AccountManagement::class]
            );
        };

        $app[UserPromoteCommand::class] = function ($app) {
            return new UserPromoteCommand(
                $app[AccountManagement::class]
            );
        };

        $app[Application::class] = function ($app) {
            $console = new Application();

            $console->setDispatcher($app['dispatcher']);
            $console->addCommands([
                $app[ClearCacheCommand::class],
                $app[UserCreateCommand::class],
                $app[UserDemoteCommand::class],
                $app[UserPromoteCommand::class],
            ]);

            return $console;
        };
    }
}
<commit_msg>Fix: No need to wrap single argument<commit_after><?php

declare(strict_types=1);

/**
 * Copyright (c) 2013-2017 OpenCFP
 *
 * For the full copyright and license information, please view
 * the LICENSE file that was distributed with this source code.
 *
 * @see https://github.com/opencfp/opencfp
 */

namespace OpenCFP\Provider\Gateways;

use OpenCFP\Console\Application;
use OpenCFP\Console\Command\ClearCacheCommand;
use OpenCFP\Console\Command\UserCreateCommand;
use OpenCFP\Console\Command\UserDemoteCommand;
use OpenCFP\Console\Command\UserPromoteCommand;
use OpenCFP\Domain\Services\AccountManagement;
use OpenCFP\Path;
use Pimple\Container;
use Pimple\ServiceProviderInterface;

final class ConsoleGatewayProvider implements ServiceProviderInterface
{
    public function register(Container $app)
    {
        $app[ClearCacheCommand::class] = function ($app) {
            /** @var Path $path */
            $path = $app['path'];

            return new ClearCacheCommand([
                $path->cachePurifierPath(),
                $path->cacheTwigPath(),
            ]);
        };

        $app[UserCreateCommand::class] = function ($app) {
            return new UserCreateCommand($app[AccountManagement::class]);
        };

        $app[UserDemoteCommand::class] = function ($app) {
            return new UserDemoteCommand($app[AccountManagement::class]);
        };

        $app[UserPromoteCommand::class] = function ($app) {
            return new UserPromoteCommand($app[AccountManagement::class]);
        };

        $app[Application::class] = function ($app) {
            $console = new Application();

            $console->setDispatcher($app['dispatcher']);
            $console->addCommands([
                $app[ClearCacheCommand::class],
                $app[UserCreateCommand::class],
                $app[UserDemoteCommand::class],
                $app[UserPromoteCommand::class],
            ]);

            return $console;
        };
    }
}

{'fraction_non_alphanumeric': 0.1179538117705488, 'fraction_numerical': 0.004469828656568165, 'mean_word_length': 2.530236634531113, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 2, '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': '4818462', 'n_tokens_mistral': 1105, 'n_tokens_neox': 1057, 'n_words': 211}