ArrayOfEntity   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getOtherUsers() 0 3 1
A getUsers() 0 4 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\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