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

HasIdentifier::setId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
dl 0
loc 5
ccs 3
cts 3
cp 1
rs 10
c 1
b 0
f 0
cc 1
nc 1
nop 1
crap 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