1 | <?php |
||
14 | class ClosureCommand extends Command |
||
15 | { |
||
16 | /** |
||
17 | * The command callback. |
||
18 | * |
||
19 | * @var \Closure |
||
20 | */ |
||
21 | protected $callback; |
||
22 | |||
23 | /** |
||
24 | * Create a new command instance. |
||
25 | * |
||
26 | * @param string $signature |
||
27 | * @param \Closure $callback |
||
28 | * @return void |
||
|
|||
29 | */ |
||
30 | 1 | public function __construct($signature, Closure $callback) |
|
37 | |||
38 | /** |
||
39 | * Execute the console command. |
||
40 | * |
||
41 | * @param \Symfony\Component\Console\Input\InputInterface $input |
||
42 | * @param \Symfony\Component\Console\Output\OutputInterface $output |
||
43 | * @return mixed |
||
44 | */ |
||
45 | protected function execute(InputInterface $input, OutputInterface $output) |
||
61 | |||
62 | /** |
||
63 | * Set the description for the command. |
||
64 | * |
||
65 | * @param string $description |
||
66 | * @return $this |
||
67 | */ |
||
68 | 1 | public function describe($description) |
|
74 | } |
||
75 |
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.