SelfUpdateCommand   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 1
eloc 5
c 3
b 0
f 0
dl 0
loc 20
rs 10
ccs 0
cts 3
cp 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 5 1
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