<commit_before><?php

namespace Pantheon\Terminus\Commands\Self\Plugin;

use Consolidation\AnnotatedCommand\CommandData;
use Pantheon\Terminus\Exceptions\TerminusNotFoundException;
use Pantheon\Terminus\Exceptions\TerminusException;
use Pantheon\Terminus\Plugins\PluginInfo;

/**
 * Creates a new Terminus plugin using Composer.
 * @package Pantheon\Terminus\Commands\Self\Plugin
 */
class CreateCommand extends PluginBaseCommand
{
    const USAGE_MESSAGE = 'terminus self:plugin:create <path>';
    const EXISTING_FOLDER_MESSAGE = 'Path should be a non-existing folder that will be created';
    // @todo Switch from dev-php80-cleanup version to 2.x when branch gets merged.
    const COMPOSER_CREATE_PROJECT =
        'composer create-project pantheon-systems/terminus-plugin-example:dev-php80-cleanup {dir}';

    /**
     * Create a new terminus plugin.
     *
     * @command self:plugin:create
     * @aliases self:plugin:new
     *
     * @param string $path Path where the plugin will be created.
     * @option project-name Namme of the project to be created (vendor/project-name).
     *
     * @usage <path> --project-name=vendor/project_name
     */
    public function create(string $path, $options = [
        'project-name' => '',
    ])
    {
        $project_name = $options['project-name'];
        if (!file_exists($path)) {
            $results = $this->doCreate($path, $project_name);
            $this->log()->notice($results['output']);<commit_msg>Undo temporary change to switch back to released packagist version. (#2211)<commit_after><?php

namespace Pantheon\Terminus\Commands\Self\Plugin;

use Consolidation\AnnotatedCommand\CommandData;
use Pantheon\Terminus\Exceptions\TerminusNotFoundException;
use Pantheon\Terminus\Exceptions\TerminusException;
use Pantheon\Terminus\Plugins\PluginInfo;

/**
 * Creates a new Terminus plugin using Composer.
 * @package Pantheon\Terminus\Commands\Self\Plugin
 */
class CreateCommand extends PluginBaseCommand
{
    const USAGE_MESSAGE = 'terminus self:plugin:create <path>';
    const EXISTING_FOLDER_MESSAGE = 'Path should be a non-existing folder that will be created';
    const COMPOSER_CREATE_PROJECT = 'composer create-project pantheon-systems/terminus-plugin-example {dir}';

    /**
     * Create a new terminus plugin.
     *
     * @command self:plugin:create
     * @aliases self:plugin:new
     *
     * @param string $path Path where the plugin will be created.
     * @option project-name Namme of the project to be created (vendor/project-name).
     *
     * @usage <path> --project-name=vendor/project_name
     */
    public function create(string $path, $options = [
        'project-name' => '',
    ])
    {
        $project_name = $options['project-name'];
        if (!file_exists($path)) {
            $results = $this->doCreate($path, $project_name);
            $this->log()->notice($results['output']);
{'fraction_non_alphanumeric': 0.11606217616580311, 'fraction_numerical': 0.0031088082901554403, 'mean_word_length': 3.525, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 15, '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': '3821433', 'n_tokens_mistral': 871, 'n_tokens_neox': 847, 'n_words': 206}