X-Git-Url: https://yaffs.net/gitweb/?a=blobdiff_plain;f=vendor%2Fbehat%2Fbehat%2Fsrc%2FBehat%2FTestwork%2FEventDispatcher%2FCli%2FSigintController.php;fp=vendor%2Fbehat%2Fbehat%2Fsrc%2FBehat%2FTestwork%2FEventDispatcher%2FCli%2FSigintController.php;h=0000000000000000000000000000000000000000;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hp=24a639c9c9c624eb1f7f2cbbc50c5dae014f3762;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0;p=yaffs-website diff --git a/vendor/behat/behat/src/Behat/Testwork/EventDispatcher/Cli/SigintController.php b/vendor/behat/behat/src/Behat/Testwork/EventDispatcher/Cli/SigintController.php deleted file mode 100644 index 24a639c9c..000000000 --- a/vendor/behat/behat/src/Behat/Testwork/EventDispatcher/Cli/SigintController.php +++ /dev/null @@ -1,70 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Behat\Testwork\EventDispatcher\Cli; - -use Behat\Testwork\Cli\Controller; -use Behat\Testwork\EventDispatcher\Event\AfterExerciseAborted; -use Behat\Testwork\EventDispatcher\Event\ExerciseCompleted; -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\EventDispatcher\EventDispatcherInterface; - -/** - * Aborts exercise on SIGINT signal. - * - * @author Konstantin Kudryashov - */ -final class SigintController implements Controller -{ - /** - * @var EventDispatcherInterface - */ - private $eventDispatcher; - - /** - * Initializes controller. - * - * @param EventDispatcherInterface $eventDispatcher - */ - public function __construct(EventDispatcherInterface $eventDispatcher) - { - $this->eventDispatcher = $eventDispatcher; - } - - /** - * {@inheritdoc} - */ - public function configure(Command $command) - { - } - - /** - * {@inheritdoc} - */ - public function execute(InputInterface $input, OutputInterface $output) - { - if (function_exists('pcntl_signal')) { - declare(ticks = 1); - pcntl_signal(SIGINT, array($this, 'abortExercise')); - } - } - - /** - * Dispatches AFTER exercise event and exits program. - */ - public function abortExercise() - { - $this->eventDispatcher->dispatch(ExerciseCompleted::AFTER, new AfterExerciseAborted()); - - exit(1); - } -}