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

HasVersion::fakeVersion()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
dl 0
loc 6
ccs 4
cts 4
cp 1
rs 10
c 1
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace VGirol\JsonApiFaker\Factory;
6
7
trait HasVersion
8
{
9
    /**
10
     * Undocumented variable
11
     *
12
     * @var string
13
     */
14
    public $version;
15
16
    /**
17
     * Undocumented function
18
     *
19
     * @param string $version
20
     * @return static
21
     */
22 4
    public function setVersion(string $version)
23
    {
24 4
        $this->version = $version;
25
26 4
        return $this;
27
    }
28
29
    /**
30
     * Undocumented function
31
     *
32
     * @return static
33
     */
34 2
    public function fakeVersion()
35
    {
36 2
        $faker = \Faker\Factory::create();
37
38 2
        return $this->setVersion(
39 2
            $faker->randomDigitNotNull . '.' . $faker->randomDigit
40
        );
41
    }
42
}
43