Passed
Push — master ( 10f5e3...fae6f1 )
by Adrien
11:59 queued 09:32
created

ArrayOfEntity   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 3
c 1
b 0
f 0
dl 0
loc 16
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getOtherUsers() 0 3 1
A getUsers() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace GraphQLTests\Doctrine\Blog\Model\Special;
6
7
use Doctrine\Common\Collections\ArrayCollection;
8
use Doctrine\Common\Collections\Collection;
9
use Doctrine\ORM\Mapping as ORM;
10
use GraphQL\Doctrine\Annotation as API;
11
use GraphQLTests\Doctrine\Blog\Model\AbstractModel;
12
use GraphQLTests\Doctrine\Blog\Model\User;
13
14
/**
15
 * @ORM\Entity
16
 */
17
final class ArrayOfEntity extends AbstractModel
18
{
19
    /**
20
     * @API\Field(type="GraphQLTests\Doctrine\Blog\Model\User[]")
21
     */
22
    public function getUsers(): array
23
    {
24
        return [new User(), new User()];
25
    }
26
27
    /**
28
     * @return Collection<\GraphQLTests\Doctrine\Blog\Model\User>
29
     */
30
    public function getOtherUsers(): Collection
31
    {
32
        return new ArrayCollection([new User(), new User()]);
33
    }
34
}
35