Command   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 4
Bugs 0 Features 0
Metric Value
eloc 4
c 4
b 0
f 0
dl 0
loc 28
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A prepare() 0 2 1
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
}