aspirantzhang /
octopus-revision
| 1 | <?php |
||||
| 2 | |||||
| 3 | declare(strict_types=1); |
||||
| 4 | |||||
| 5 | namespace aspirantzhang\octopusRevision\command; |
||||
| 6 | |||||
| 7 | use think\console\Command; |
||||
| 8 | use think\console\Input; |
||||
| 9 | use think\console\input\Argument; |
||||
| 10 | use think\console\Output; |
||||
| 11 | use aspirantzhang\octopusRevision\RevisionAPI; |
||||
| 12 | |||||
| 13 | class Read extends Command |
||||
| 14 | { |
||||
| 15 | protected function configure() |
||||
| 16 | { |
||||
| 17 | $this->setName('revision:read') |
||||
| 18 | ->addArgument('revisionId', Argument::REQUIRED, "Revision id") |
||||
| 19 | ->setDescription('View the details of a revision'); |
||||
| 20 | } |
||||
| 21 | |||||
| 22 | protected function execute(Input $input, Output $output) |
||||
| 23 | { |
||||
| 24 | $revisionId = trim($input->getArgument('revisionId')); |
||||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||||
| 25 | |||||
| 26 | $result = (new RevisionAPI())->readAPI((int)$revisionId); |
||||
| 27 | if ($result['success'] === true) { |
||||
| 28 | $output->writeln('<comment>' . print_r($result['data']['dataSource']) . '</comment>'); |
||||
|
0 ignored issues
–
show
Are you sure
print_r($result['data']['dataSource']) of type string|true can be used in concatenation?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
| 29 | } else { |
||||
| 30 | $output->writeln('<error>' . $result['message'] . '</error>'); |
||||
| 31 | } |
||||
| 32 | } |
||||
| 33 | } |
||||
| 34 |