Subversion-Projekte lars-tiefland.laravel_shop

Revision

Revision 148 | Details | Vergleich mit vorheriger | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
148 lars 1
<?php
2
 
3
/*
4
 * This file is part of Psy Shell.
5
 *
200 lars 6
 * (c) 2012-2023 Justin Hileman
148 lars 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(['quit', 'q'])
33
            ->setDefinition([])
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
     * @return int 0 if everything went fine, or an exit code
49
     */
50
    protected function execute(InputInterface $input, OutputInterface $output)
51
    {
52
        throw new BreakException('Goodbye');
53
    }
54
}