Command::prepare()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 1
eloc 0
c 2
b 0
f 0
nc 1
nop 1
dl 0
loc 2
rs 10
1
<?php
2
3
namespace pjpawel\LightApi\Command;
4
5
use pjpawel\LightApi\Command\Input\InputInterface;
6
use pjpawel\LightApi\Command\Output\OutputInterface;
7
8
abstract class Command
9
{
10
11
    public const SUCCESS = 0;
12
    public const FAILURE = 1;
13
    public const INVALID = 2;
14
15
    /**
16
     * Method to prepare command arguments
17
     *
18
     * @param InputInterface $input
19
     * @return void
20
     */
21
    public function prepare(/** @scrutinizer ignore-unused */ InputInterface $input): void
22
    {
23
24
    }
25
26
    /**
27
     * In this method you should be implement main logic of your command
28
     * In $input you will find arguments and options
29
     * In $output write to console
30
     *
31
     * @param InputInterface $input
32
     * @param OutputInterface $output
33
     * @return int
34
     */
35
    abstract public function execute(InputInterface $input, OutputInterface $output): int;
36
}