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

ArrayOfEntity::getOtherUsers()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
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