Completed
Push — master ( cd5f41...3e5383 )
by Miro
03:08
created

SampleDataProvider::getCommit()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

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