Completed
Push — master ( a787fa...dc9af5 )
by Vincent
05:35
created

ResourceIdentifierFactory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A toArray() 0 9 2
1
<?php
2
declare (strict_types = 1);
3
4
namespace VGirol\JsonApiAssert\Factory;
5
6
use VGirol\JsonApiAssert\Members;
7
8
class ResourceIdentifierFactory extends BaseFactory
9
{
10
    use HasIdentification;
11
    use HasMeta;
12
13
    public function toArray(): ?array
14
    {
15
        $resource = $this->getIdentification();
16
17
        if (isset($this->meta)) {
18
            $resource[Members::META] = $this->meta;
19
        }
20
21
        return $resource;
22
    }
23
}
24