ArrayOfEntity::getUsers()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 4
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\Attribute as API;
11
use GraphQLTests\Doctrine\Blog\Model\AbstractModel;
12
use GraphQLTests\Doctrine\Blog\Model\User;
13
14
#[ORM\Entity]
15
final class ArrayOfEntity extends AbstractModel
16
{
17
    #[API\Field(type: 'GraphQLTests\Doctrine\Blog\Model\User[]')]
18
    public function getUsers(): array
19
    {
20
        return [new User(), new User()];
21
    }
22
23
    /**
24
     * @return Collection<int, User>
25
     */
26
    public function getOtherUsers(): Collection
27
    {
28
        return new ArrayCollection([new User(), new User()]);
29
    }
30
}
31