Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
n/a
0 / 0
n/a
0 / 0
CRAP
n/a
0 / 0
1<?php
2declare(strict_types=1);
3/**
4 * Pop PHP Framework (https://www.popphp.org/)
5 *
6 * @link       https://github.com/popphp/popphp-framework
7 * @author     Nick Sagona, III <nick@popphp.org>
8 * @copyright  Copyright (c) 2009-2026 Nick Sagona, III
9 * @license    https://www.popphp.org/license     New BSD License
10 */
11
12/**
13 * @namespace
14 */
15namespace Pop\Console\Command;
16
17/**
18 * Console command interface
19 *
20 * @category   Pop
21 * @package    Pop\Console
22 * @author     Nick Sagona, III <nick@popphp.org>
23 * @copyright  Copyright (c) 2009-2026 Nick Sagona, III
24 * @license    https://www.popphp.org/license     New BSD License
25 * @version    5.0.0
26 */
27interface CommandInterface
28{
29
30    /**
31     * Set the command name
32     *
33     * @param  string $name
34     * @return static
35     */
36    public function setName(string $name): static;
37
38    /**
39     * Set the command params
40     *
41     * @param  string $params
42     * @return static
43     */
44    public function setParams(string $params): static;
45
46    /**
47     * Set the command help
48     *
49     * @param  string $help
50     * @return static
51     */
52    public function setHelp(string $help): static;
53
54    /**
55     * Set the script name the command was registered under
56     *
57     * @param  string $scriptName
58     * @return static
59     */
60    public function setScriptName(string $scriptName): static;
61
62    /**
63     * Get the command name
64     *
65     * @return ?string
66     */
67    public function getName(): ?string;
68
69    /**
70     * Get the command params
71     *
72     * @return ?string
73     */
74    public function getParams(): ?string;
75
76    /**
77     * Get the command help
78     *
79     * @return ?string
80     */
81    public function getHelp(): ?string;
82
83    /**
84     * Get the script name the command was registered under
85     *
86     * @return ?string
87     */
88    public function getScriptName(): ?string;
89
90    /**
91     * Determine if the command has name
92     *
93     * @return bool
94     */
95    public function hasName(): bool;
96
97    /**
98     * Determine if the command has params
99     *
100     * @return bool
101     */
102    public function hasParams(): bool;
103
104    /**
105     * Determine if the command has help
106     *
107     * @return bool
108     */
109    public function hasHelp(): bool;
110
111    /**
112     * Determine if the command has a script name
113     *
114     * @return bool
115     */
116    public function hasScriptName(): bool;
117
118    /**
119     * Render the command as its name and params
120     *
121     * @return string
122     */
123    public function __toString(): string;
124
125}