SelfUpdateCommand::handle()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 5
ccs 0
cts 3
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 2
1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * This file is part of Laravel Zero.
7
 *
8
 * (c) Nuno Maduro <[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 LaravelZero\Framework\Components\Updater;
15
16
use LaravelZero\Framework\Commands\Command;
17
18
class SelfUpdateCommand extends Command
19
{
20
    /**
21
     * {@inheritdoc}
22
     */
23
    protected $name = 'self-update';
24
25
    /**
26
     * {@inheritdoc}
27
     */
28
    protected $description = 'Allows to self-update a build application';
29
30
    /**
31
     * {@inheritdoc}
32
     */
33
    public function handle(Updater $updater)
34
    {
35
        $this->output->title('Checking for a new version...');
36
37
        $result = $updater->update($this->output);
0 ignored issues
show
Bug introduced by
Are you sure the assignment to $result is correct as $updater->update($this->output) targeting LaravelZero\Framework\Co...dater\Updater::update() 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...
38
    }
39
}
40