Issues (14)

src/Command/SelfUpdateCommand.php (2 issues)

1
<?php
2
3
/*
4
 * This file is part of CacheTool.
5
 *
6
 * (c) Samuel Gordalina <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace CacheTool\Command;
13
14
use Symfony\Component\Console\Input\InputInterface;
15
use Symfony\Component\Console\Output\OutputInterface;
16
17
class SelfUpdateCommand extends \SelfUpdate\SelfUpdateCommand
18
{
19 25
    protected function configure()
20
    {
21 25
        $app = $this->applicationName;
22
23
        $this
24 25
            ->setAliases(array('self-update'))
25 25
            ->setDescription("Updates $app to the latest version.")
26 25
            ->setHelp(
27
                <<<EOT
28
  The <info>self-update</info> command checks github for newer
29 25
  versions of $app and if found, installs the latest.
30
  EOT
31
            );
32 25
    }
33
34
    protected function execute(InputInterface $input, OutputInterface $output) {
35
        $result = parent::execute($input, $output);
0 ignored issues
show
Are you sure the assignment to $result is correct as parent::execute($input, $output) targeting SelfUpdate\SelfUpdateCommand::execute() seems to always return null.

This check looks for function or method calls that always return null and whose return value is assigned to a variable.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
$object = $a->getObject();

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.

Loading history...
36
37
        if (is_int($result)) {
0 ignored issues
show
The condition is_int($result) is always false.
Loading history...
38
           return $result;
39
        }
40
41
        return 0;
42
    }
43
}
44