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

GitIgnoreDataResponseStub   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 1
Bugs 1 Features 0
Metric Value
wmc 3
c 1
b 1
f 0
lcom 0
cbo 3
dl 0
loc 30
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A create() 0 4 1
A random() 0 4 1
A randomWithGuardCoverage() 0 6 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