These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | declare(strict_types=1); |
||
4 | |||
5 | /* |
||
6 | * This file is part of the "php-ipfs" package. |
||
7 | * |
||
8 | * (c) Robert Schönthal <[email protected]> |
||
9 | * |
||
10 | * For the full copyright and license information, please view the LICENSE |
||
11 | * file that was distributed with this source code. |
||
12 | */ |
||
13 | |||
14 | namespace IPFS\Console; |
||
15 | |||
16 | use Symfony\Component\Console\Command\Command; |
||
17 | use Symfony\Component\Console\Input\InputInterface; |
||
18 | use Symfony\Component\Console\Output\OutputInterface; |
||
19 | |||
20 | class ApiBuildCommand extends Command |
||
21 | { |
||
22 | /** |
||
23 | * @var callable |
||
24 | */ |
||
25 | private $builder; |
||
26 | |||
27 | 3 | public function __construct(callable $builder) |
|
28 | { |
||
29 | 3 | parent::__construct(null); |
|
30 | 3 | $this->builder = $builder; |
|
31 | 3 | } |
|
32 | |||
33 | 3 | protected function configure() |
|
34 | { |
||
35 | $this |
||
36 | 3 | ->setName('rebuild') |
|
37 | 3 | ->setDescription('rebuild api classes by parsing the official api doc') |
|
38 | ; |
||
39 | 3 | } |
|
40 | |||
41 | 1 | protected function execute(InputInterface $input, OutputInterface $output) |
|
42 | { |
||
43 | 1 | $this->builder->__invoke()->build(); |
|
0 ignored issues
–
show
|
|||
44 | |||
45 | 1 | $output->writeln('updated Api Classes in <info>src/Api</info>'); |
|
46 | 1 | } |
|
47 | } |
||
48 |
Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.