Version 1
[yaffs-website] / vendor / psy / psysh / src / Psy / Command / ExitCommand.php
1 <?php
2
3 /*
4  * This file is part of Psy Shell.
5  *
6  * (c) 2012-2017 Justin Hileman
7  *
8  * For the full copyright and license information, please view the LICENSE
9  * file that was distributed with this source code.
10  */
11
12 namespace Psy\Command;
13
14 use Psy\Exception\BreakException;
15 use Symfony\Component\Console\Input\InputInterface;
16 use Symfony\Component\Console\Output\OutputInterface;
17
18 /**
19  * Exit the Psy Shell.
20  *
21  * Just what it says on the tin.
22  */
23 class ExitCommand extends Command
24 {
25     /**
26      * {@inheritdoc}
27      */
28     protected function configure()
29     {
30         $this
31             ->setName('exit')
32             ->setAliases(array('quit', 'q'))
33             ->setDefinition(array())
34             ->setDescription('End the current session and return to caller.')
35             ->setHelp(
36                 <<<'HELP'
37 End the current session and return to caller.
38
39 e.g.
40 <return>>>> exit</return>
41 HELP
42             );
43     }
44
45     /**
46      * {@inheritdoc}
47      */
48     protected function execute(InputInterface $input, OutputInterface $output)
49     {
50         throw new BreakException('Goodbye.');
51     }
52 }