Completed
Push — master ( dfad4d...8cf454 )
by Philip
21:24
created

UserListCommand::execute()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 2
1
<?php
2
3
4
namespace Dontdrinkandroot\Gitki\WebBundle\Command;
5
6
use Symfony\Component\Console\Input\InputInterface;
7
use Symfony\Component\Console\Output\OutputInterface;
8
9
class UserListCommand extends AbstractUserCommand
10
{
11
    protected function configure()
12
    {
13
        $this
14
            ->setName('gitki:user:list')
15
            ->setDescription('Lists the existing users');
16
    }
17
18
    protected function execute(InputInterface $input, OutputInterface $output)
19
    {
20
        $users = $this->findUsers();
21
        $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<Don...WebBundle\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...
22
    }
23
}
24