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

UserListCommand   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 15
rs 10
c 0
b 0
f 0

2 Methods

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