Sha256: 72c840c3bc58d17a8875274de83d2597fac31a31c2c6f8909f5bb5f7de7e3db3

Contents?: true

Size: 1.29 KB

Versions: 42

Compression:

Stored size: 1.29 KB

Contents

<?php

/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Console\Event;

/**
 * Allows to do things before the command is executed, like skipping the command or changing the input.
 *
 * @author Fabien Potencier <fabien@symfony.com>
 */
class ConsoleCommandEvent extends ConsoleEvent
{
    /**
     * The return code for skipped commands, this will also be passed into the terminate event.
     */
    const RETURN_CODE_DISABLED = 113;

    /**
     * Indicates if the command should be run or skipped.
     */
    private $commandShouldRun = true;

    /**
     * Disables the command, so it won't be run.
     *
     * @return bool
     */
    public function disableCommand()
    {
        return $this->commandShouldRun = false;
    }

    /**
     * Enables the command.
     *
     * @return bool
     */
    public function enableCommand()
    {
        return $this->commandShouldRun = true;
    }

    /**
     * Returns true if the command is runnable, false otherwise.
     *
     * @return bool
     */
    public function commandShouldRun()
    {
        return $this->commandShouldRun;
    }
}

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
dependabot-composer-0.119.0.beta1 helpers/vendor/symfony/console/Event/ConsoleCommandEvent.php
dependabot-composer-0.113.19 helpers/vendor/symfony/console/Event/ConsoleCommandEvent.php
dependabot-composer-0.112.1 helpers/vendor/symfony/console/Event/ConsoleCommandEvent.php
dependabot-composer-0.111.57 helpers/vendor/symfony/console/Event/ConsoleCommandEvent.php
dependabot-composer-0.111.56 helpers/vendor/symfony/console/Event/ConsoleCommandEvent.php
dependabot-composer-0.111.52 helpers/vendor/symfony/console/Event/ConsoleCommandEvent.php
dependabot-composer-0.111.50 helpers/vendor/symfony/console/Event/ConsoleCommandEvent.php
dependabot-composer-0.111.25 helpers/vendor/symfony/console/Event/ConsoleCommandEvent.php
dependabot-composer-0.111.17 helpers/vendor/symfony/console/Event/ConsoleCommandEvent.php
dependabot-composer-0.111.15 helpers/vendor/symfony/console/Event/ConsoleCommandEvent.php
dependabot-composer-0.110.13 helpers/vendor/symfony/console/Event/ConsoleCommandEvent.php
dependabot-composer-0.108.11 helpers/vendor/symfony/console/Event/ConsoleCommandEvent.php
dependabot-composer-0.108.8 helpers/vendor/symfony/console/Event/ConsoleCommandEvent.php
dependabot-composer-0.107.47 helpers/vendor/symfony/console/Event/ConsoleCommandEvent.php
dependabot-composer-0.107.39 helpers/vendor/symfony/console/Event/ConsoleCommandEvent.php
dependabot-composer-0.107.36 helpers/vendor/symfony/console/Event/ConsoleCommandEvent.php
dependabot-composer-0.107.28 helpers/vendor/symfony/console/Event/ConsoleCommandEvent.php
dependabot-composer-0.107.14 helpers/vendor/symfony/console/Event/ConsoleCommandEvent.php
dependabot-composer-0.106.12 helpers/vendor/symfony/console/Event/ConsoleCommandEvent.php
dependabot-composer-0.106.11 helpers/vendor/symfony/console/Event/ConsoleCommandEvent.php