Completed
Pull Request — master (#67)
by Pablo
02:31
created

GitIgnoreDataResponseStub::create()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
c 1
b 1
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace PhpGitHooks\Module\Git\Tests\Stub;
4
5
use PhpGitHooks\Module\Git\Contract\Response\GitIgnoreDataResponse;
6
use PhpGitHooks\Module\Tests\Infrastructure\Stub\RandomStubInterface;
7
use PhpGitHooks\Module\Tests\Infrastructure\Stub\StubCreator;
8
9
class GitIgnoreDataResponseStub implements RandomStubInterface
10
{
11
    /**
12
     * @param string $value
13
     *
14
     * @return GitIgnoreDataResponse
15
     */
16
    public static function create($value)
17
    {
18
        return new GitIgnoreDataResponse($value);
19
    }
20
21
    /**
22
     * @return GitIgnoreDataResponse
23
     */
24
    public static function random()
25
    {
26
        return self::create(StubCreator::faker()->text());
27
    }
28
29
    /**
30
     * @return GitIgnoreDataResponse
31
     */
32
    public static function randomWithGuardCoverage()
33
    {
34
        $data = StubCreator::faker()->text()."\n".'.guard_coverage';
35
36
        return self::create($data);
37
    }
38
}
39