1 | <?php |
||
2 | |||
3 | namespace wapmorgan\UnifiedArchive\Commands; |
||
4 | |||
5 | use Symfony\Component\Console\Input\InputArgument; |
||
6 | use Symfony\Component\Console\Input\InputInterface; |
||
7 | use Symfony\Component\Console\Output\OutputInterface; |
||
8 | |||
9 | class CommentCommand extends BaseArchiveCommand |
||
10 | { |
||
11 | protected static $defaultName = 'archive:comment'; |
||
12 | |||
13 | protected function configure() |
||
14 | { |
||
15 | parent::configure(); |
||
16 | $this |
||
17 | ->setDescription('Sets comment on archive') |
||
18 | ->setHelp('Sets comment on archive.') |
||
19 | ->addArgument('comment', InputArgument::REQUIRED, 'Comment') |
||
20 | ; |
||
21 | } |
||
22 | |||
23 | public function execute(InputInterface $input, OutputInterface $output) |
||
24 | { |
||
25 | $archive = $this->getArchive($input, $output); |
||
26 | $comment = $input->getArgument('comment'); |
||
27 | if (empty($comment)) { |
||
28 | $comment = null; |
||
29 | } |
||
30 | |||
31 | if (!empty($previous_comment = $archive->getComment())) { |
||
0 ignored issues
–
show
|
|||
32 | $output->writeln('Comment "' . $previous_comment . '" replaced', OutputInterface::OUTPUT_RAW); |
||
33 | } else if ($comment === null) { |
||
34 | $output->writeln('Comment deleted', OutputInterface::OUTPUT_RAW); |
||
35 | } else { |
||
36 | $output->writeln('Comment set', OutputInterface::OUTPUT_RAW); |
||
37 | } |
||
38 | |||
39 | $archive->setComment($comment); |
||
40 | |||
41 | return 0; |
||
42 | } |
||
43 | } |
||
44 |
This check looks for function or method calls that always return null and whose return value is assigned to a variable.
The method
getObject()
can return nothing but null, so it makes no sense to assign that value to a variable.The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.