Completed
Push — master ( 4b6f0b...499570 )
by Philip
22:53
created

UserListCommand::configure()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 0
1
<?php
2
3
namespace App\Command;
4
5
use Symfony\Component\Console\Input\InputInterface;
6
use Symfony\Component\Console\Output\OutputInterface;
7
8
class UserListCommand extends AbstractUserCommand
9
{
10
    protected function configure()
11
    {
12
        $this
13
            ->setName('gitki:user:list')
14
            ->setDescription('Lists the existing users');
15
    }
16
17
    protected function execute(InputInterface $input, OutputInterface $output)
18
    {
19
        $users = $this->findUsers();
20
        $this->printUserTable($output, $users);
0 ignored issues
show
Documentation introduced by
$users is of type object<Traversable>, but the function expects a array<integer,object<App\Entity\User>>.

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...
21
    }
22
}
23