Updater   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 21
ccs 0
cts 5
cp 0
rs 10
c 1
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A execute() 0 8 2
1
<?php
2
3
/*
4
 * This file is part of Rocketeer
5
 *
6
 * (c) Maxime Fabre <[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
13
namespace Rocketeer\Tasks\Plugins;
14
15
/**
16
 * Updates one or more plugins.
17
 */
18
class Updater extends Installer
19
{
20
    /**
21
     * The console command description.
22
     *
23
     * @var string
24
     */
25
    protected $description = 'Updates one or more plugins';
26
27
    /**
28
     * {@inheritdoc}
29
     */
30
    public function execute()
31
    {
32
        // Get package and destination folder
33
        $package = $this->getPackage();
34
35
        $arguments = $package ? [$package] : null;
36
        $this->runComposerMethod('update', $arguments);
0 ignored issues
show
Documentation introduced by Maxime Fabre
$arguments is of type array<integer,string|arr...":"string|array"}>|null, but the function expects a string|array<integer,string>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
37
    }
38
}
39