Completed
Push — master ( 883f28...097345 )
by Vincent
03:45 queued 11s
created

HasIdentifier   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 6
dl 0
loc 32
ccs 6
cts 6
cp 1
rs 10
c 1
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setId() 0 5 1
A fakeIdentifier() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace VGirol\JsonApiFaker\Factory;
6
7
use VGirol\JsonApiFaker\Members;
8
9
trait HasIdentifier
10
{
11
    /**
12
     * Undocumented variable
13
     *
14
     * @var int|string|null
15
     */
16
    public $id;
17
18
    /**
19
     * Undocumented function
20
     *
21
     * @param int|string|null $resourceId
22
     * @return static
23
     */
24 25
    public function setId($resourceId)
25
    {
26 25
        $this->id = $resourceId;
27
28 25
        return $this;
29
    }
30
31
    /**
32
     * Undocumented function
33
     *
34
     * @return static
35
     */
36 11
    public function fakeIdentifier()
37
    {
38 11
        $faker = \Faker\Factory::create();
39
40 11
        return $this->setId($faker->numberBetween(1, 100));
41
    }
42
}
43