Completed
Pull Request — master (#8)
by Miro
03:40
created

SampleDataProvider::getAllBranches()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 6
rs 9.4285
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
namespace tests\DevBoardLib\GithubObjectApiFacade;
3
4
/**
5
 * Class SampleDataProvider.
6
 */
7
class SampleDataProvider
8
{
9
    /**
10
     * @return mixed
11
     */
12
    public function getRepoDetails()
13
    {
14
        $content = file_get_contents(__DIR__.'/sample-data/devboard/test-hitman/repo-details.json');
15
16
        return json_decode($content, true);
17
    }
18
19
    /**
20
     * @return mixed
21
     */
22
    public function getBranch()
23
    {
24
        $content = file_get_contents(__DIR__.'/sample-data/devboard/test-hitman/branch-master.json');
25
26
        return json_decode($content, true);
27
    }
28
29
    /**
30
     * @return mixed
31
     */
32
    public function getAllBranches()
33
    {
34
        $content = file_get_contents(__DIR__.'/sample-data/devboard/test-hitman/branches.json');
35
36
        return json_decode($content, true);
37
    }
38
39
    /**
40
     * @return mixed
41
     */
42
    public function getAllBranchNames()
43
    {
44
        $content = file_get_contents(__DIR__.'/sample-data/devboard/test-hitman/branchnames.json');
45
46
        return json_decode($content, true);
47
    }
48
49
    /**
50
     * @return mixed
51
     */
52
    public function getAllTagNames()
53
    {
54
        $content = file_get_contents(__DIR__.'/sample-data/devboard/test-hitman/tags.json');
55
56
        return json_decode($content, true);
57
    }
58
59
    /**
60
     * @return mixed
61
     */
62
    public function getCommit()
63
    {
64
        $content = file_get_contents(
65
            __DIR__.'/sample-data/devboard/test-hitman/commit-db911bd3a3dd8bb2ad9eccbcb0a396595a51491d.json'
66
        );
67
68
        return json_decode($content, true);
69
    }
70
71
    /**
72
     * @return mixed
73
     */
74
    public function getCommitStatus()
75
    {
76
        $content = file_get_contents(
77
            __DIR__.'/sample-data/devboard/test-hitman/commit_status-db911bd3a3dd8bb2ad9eccbcb0a396595a51491d.json'
78
        );
79
80
        return json_decode($content, true);
81
    }
82
83
    /**
84
     * @return mixed
85
     */
86
    public function getCommitStatuses()
87
    {
88
        $content = file_get_contents(
89
            __DIR__.'/sample-data/devboard/test-hitman/commit_statuses-db911bd3a3dd8bb2ad9eccbcb0a396595a51491d.json'
90
        );
91
92
        return json_decode($content, true);
93
    }
94
95
    /**
96
     * @return mixed
97
     */
98
    public function getAllPullRequests()
99
    {
100
        $content = file_get_contents(__DIR__.'/sample-data/devboard/test-hitman/pull_requests.json');
101
102
        return json_decode($content, true);
103
    }
104
105
    /**
106
     * @return mixed
107
     */
108
    public function getAllMilestones()
109
    {
110
        $content = file_get_contents(__DIR__.'/sample-data/devboard/test-hitman/milestones.json');
111
112
        return json_decode($content, true);
113
    }
114
115
    /**
116
     * @return mixed
117
     */
118
    public function getAllIssues()
119
    {
120
        $content = file_get_contents(__DIR__.'/sample-data/devboard/test-hitman/issues.json');
121
122
        return json_decode($content, true);
123
    }
124
}
125