summaryrefslogtreecommitdiff
path: root/vendor/symfony/console/Tests/Fixtures/FooLockCommand.php
blob: dfa28a6bec1f1580887f7c38270633648f5f58ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php

use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Command\LockableTrait;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

class FooLockCommand extends Command
{
    use LockableTrait;

    protected function configure()
    {
        $this->setName('foo:lock');
    }

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        if (!$this->lock()) {
            return 1;
        }

        $this->release();

        return 2;
    }
}