Passed
Push — 1.1 ( 616134...803478 )
by David
03:36
created
lib/GitHub/Receiver/Activity/Starring.php 1 patch
Indentation   +80 added lines, -80 removed lines patch added patch discarded remove patch
@@ -13,95 +13,95 @@
 block discarded – undo
13 13
 class Starring extends AbstractActivity
14 14
 {
15 15
 
16
-    /**
17
-     * List Stargazers
18
-     *
19
-     * @link https://developer.github.com/v3/activity/starring/#list-stargazers
20
-     * @return array
21
-     */
22
-    public function listStargazers(): array
23
-    {
24
-        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/stargazers',
25
-            $this->getActivity()->getOwner(), $this->getActivity()->getRepo()));
26
-    }
16
+	/**
17
+	 * List Stargazers
18
+	 *
19
+	 * @link https://developer.github.com/v3/activity/starring/#list-stargazers
20
+	 * @return array
21
+	 */
22
+	public function listStargazers(): array
23
+	{
24
+		return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/stargazers',
25
+			$this->getActivity()->getOwner(), $this->getActivity()->getRepo()));
26
+	}
27 27
 
28
-    /**
29
-     * List repositories being starred
30
-     *
31
-     * @link https://developer.github.com/v3/activity/starring/#list-repositories-being-starred
32
-     *
33
-     * @param string $sort
34
-     * @param string $direction
35
-     * @param string $username
36
-     *
37
-     * @return array
38
-     */
39
-    public function listRepositories(string $sort = AbstractApi::SORT_CREATED,
40
-                                     string $direction = AbstractApi::DIRECTION_DESC, string $username = null): array
41
-    {
42
-        if (null !== $username) {
43
-            return $this->getApi()->request($this->getApi()->sprintf('/users/:username/starred?:args', $username,
44
-                http_build_query(['sort' => $sort, 'direction' => $direction])));
45
-        }
28
+	/**
29
+	 * List repositories being starred
30
+	 *
31
+	 * @link https://developer.github.com/v3/activity/starring/#list-repositories-being-starred
32
+	 *
33
+	 * @param string $sort
34
+	 * @param string $direction
35
+	 * @param string $username
36
+	 *
37
+	 * @return array
38
+	 */
39
+	public function listRepositories(string $sort = AbstractApi::SORT_CREATED,
40
+									 string $direction = AbstractApi::DIRECTION_DESC, string $username = null): array
41
+	{
42
+		if (null !== $username) {
43
+			return $this->getApi()->request($this->getApi()->sprintf('/users/:username/starred?:args', $username,
44
+				http_build_query(['sort' => $sort, 'direction' => $direction])));
45
+		}
46 46
 
47
-        return $this->getApi()->request($this->getApi()->sprintf('/user/starred?:args',
48
-            http_build_query(['sort' => $sort, 'direction' => $direction])));
49
-    }
47
+		return $this->getApi()->request($this->getApi()->sprintf('/user/starred?:args',
48
+			http_build_query(['sort' => $sort, 'direction' => $direction])));
49
+	}
50 50
 
51
-    /**
52
-     * Check if you are starring a repository
53
-     *
54
-     * @link https://developer.github.com/v3/activity/starring/#check-if-you-are-starring-a-repository
55
-     * @return bool
56
-     */
57
-    public function checkYouAreStarringRepository(): bool
58
-    {
59
-        $this->getApi()->request($this->getApi()
60
-                                      ->sprintf('/user/starred/:owner/:repo', $this->getActivity()->getOwner(),
61
-                                          $this->getActivity()->getRepo()));
51
+	/**
52
+	 * Check if you are starring a repository
53
+	 *
54
+	 * @link https://developer.github.com/v3/activity/starring/#check-if-you-are-starring-a-repository
55
+	 * @return bool
56
+	 */
57
+	public function checkYouAreStarringRepository(): bool
58
+	{
59
+		$this->getApi()->request($this->getApi()
60
+									  ->sprintf('/user/starred/:owner/:repo', $this->getActivity()->getOwner(),
61
+										  $this->getActivity()->getRepo()));
62 62
 
63
-        if ($this->getApi()->getHeaders()['Status'] == '204 No Content') {
64
-            return true;
65
-        }
63
+		if ($this->getApi()->getHeaders()['Status'] == '204 No Content') {
64
+			return true;
65
+		}
66 66
 
67
-        return false;
68
-    }
67
+		return false;
68
+	}
69 69
 
70
-    /**
71
-     * Star a repository
72
-     *
73
-     * @link https://developer.github.com/v3/activity/starring/#star-a-repository
74
-     * @return bool
75
-     */
76
-    public function starRepository(): bool
77
-    {
78
-        $this->getApi()->request($this->getApi()
79
-                                      ->sprintf('/user/starred/:owner/:repo', $this->getActivity()->getOwner(),
80
-                                          $this->getActivity()->getRepo()), Request::METHOD_PUT);
70
+	/**
71
+	 * Star a repository
72
+	 *
73
+	 * @link https://developer.github.com/v3/activity/starring/#star-a-repository
74
+	 * @return bool
75
+	 */
76
+	public function starRepository(): bool
77
+	{
78
+		$this->getApi()->request($this->getApi()
79
+									  ->sprintf('/user/starred/:owner/:repo', $this->getActivity()->getOwner(),
80
+										  $this->getActivity()->getRepo()), Request::METHOD_PUT);
81 81
 
82
-        if ($this->getApi()->getHeaders()['Status'] == '204 No Content') {
83
-            return true;
84
-        }
82
+		if ($this->getApi()->getHeaders()['Status'] == '204 No Content') {
83
+			return true;
84
+		}
85 85
 
86
-        return false;
87
-    }
86
+		return false;
87
+	}
88 88
 
89
-    /**
90
-     * Unstar a repository
91
-     *
92
-     * @link https://developer.github.com/v3/activity/starring/#unstar-a-repository
93
-     * @return bool
94
-     */
95
-    public function unStarRepository(): bool
96
-    {
97
-        $this->getApi()->request($this->getApi()
98
-                                      ->sprintf('/user/starred/:owner/:repo', $this->getActivity()->getOwner(),
99
-                                          $this->getActivity()->getRepo()), Request::METHOD_DELETE);
89
+	/**
90
+	 * Unstar a repository
91
+	 *
92
+	 * @link https://developer.github.com/v3/activity/starring/#unstar-a-repository
93
+	 * @return bool
94
+	 */
95
+	public function unStarRepository(): bool
96
+	{
97
+		$this->getApi()->request($this->getApi()
98
+									  ->sprintf('/user/starred/:owner/:repo', $this->getActivity()->getOwner(),
99
+										  $this->getActivity()->getRepo()), Request::METHOD_DELETE);
100 100
 
101
-        if ($this->getApi()->getHeaders()['Status'] == '204 No Content') {
102
-            return true;
103
-        }
101
+		if ($this->getApi()->getHeaders()['Status'] == '204 No Content') {
102
+			return true;
103
+		}
104 104
 
105
-        return false;
106
-    }
105
+		return false;
106
+	}
107 107
 }
108 108
\ No newline at end of file
Please login to merge, or discard this patch.
lib/GitHub/Receiver/Activity/AbstractActivity.php 1 patch
Indentation   +54 added lines, -54 removed lines patch added patch discarded remove patch
@@ -12,65 +12,65 @@
 block discarded – undo
12 12
 abstract class AbstractActivity
13 13
 {
14 14
 
15
-    protected $activity;
16
-    protected $api;
15
+	protected $activity;
16
+	protected $api;
17 17
 
18
-    /**
19
-     * Constructor
20
-     *
21
-     * @param Activity $activity
22
-     */
23
-    public function __construct(Activity $activity)
24
-    {
25
-        $this->setActivity($activity);
26
-        $this->setApi($activity->getApi());
27
-    }
18
+	/**
19
+	 * Constructor
20
+	 *
21
+	 * @param Activity $activity
22
+	 */
23
+	public function __construct(Activity $activity)
24
+	{
25
+		$this->setActivity($activity);
26
+		$this->setApi($activity->getApi());
27
+	}
28 28
 
29
-    /**
30
-     * Get activity
31
-     *
32
-     * @return Activity
33
-     */
34
-    public function getActivity(): Activity
35
-    {
36
-        return $this->activity;
37
-    }
29
+	/**
30
+	 * Get activity
31
+	 *
32
+	 * @return Activity
33
+	 */
34
+	public function getActivity(): Activity
35
+	{
36
+		return $this->activity;
37
+	}
38 38
 
39
-    /**
40
-     * Set activity
41
-     *
42
-     * @param Activity $activity
43
-     *
44
-     * @return AbstractActivity
45
-     */
46
-    public function setActivity(Activity $activity): AbstractActivity
47
-    {
48
-        $this->activity = $activity;
39
+	/**
40
+	 * Set activity
41
+	 *
42
+	 * @param Activity $activity
43
+	 *
44
+	 * @return AbstractActivity
45
+	 */
46
+	public function setActivity(Activity $activity): AbstractActivity
47
+	{
48
+		$this->activity = $activity;
49 49
 
50
-        return $this;
51
-    }
50
+		return $this;
51
+	}
52 52
 
53
-    /**
54
-     * Get api
55
-     *
56
-     * @return AbstractApi
57
-     */
58
-    public function getApi(): AbstractApi
59
-    {
60
-        return $this->api;
61
-    }
53
+	/**
54
+	 * Get api
55
+	 *
56
+	 * @return AbstractApi
57
+	 */
58
+	public function getApi(): AbstractApi
59
+	{
60
+		return $this->api;
61
+	}
62 62
 
63
-    /**
64
-     * Set api
65
-     *
66
-     * @param AbstractApi $api
67
-     *
68
-     * @return AbstractActivity
69
-     */
70
-    public function setApi(AbstractApi $api): AbstractActivity
71
-    {
72
-        $this->api = $api;
63
+	/**
64
+	 * Set api
65
+	 *
66
+	 * @param AbstractApi $api
67
+	 *
68
+	 * @return AbstractActivity
69
+	 */
70
+	public function setApi(AbstractApi $api): AbstractActivity
71
+	{
72
+		$this->api = $api;
73 73
 
74
-        return $this;
75
-    }
74
+		return $this;
75
+	}
76 76
 } 
77 77
\ No newline at end of file
Please login to merge, or discard this patch.
lib/GitHub/Receiver/PullRequests/AbstractPullRequests.php 1 patch
Indentation   +55 added lines, -55 removed lines patch added patch discarded remove patch
@@ -12,66 +12,66 @@
 block discarded – undo
12 12
 abstract class AbstractPullRequests
13 13
 {
14 14
 
15
-    /** Properties */
16
-    protected $pullRequests;
17
-    protected $api;
15
+	/** Properties */
16
+	protected $pullRequests;
17
+	protected $api;
18 18
 
19
-    /**
20
-     * Constructor
21
-     *
22
-     * @param PullRequests $pullRequests
23
-     */
24
-    public function __construct(PullRequests $pullRequests)
25
-    {
26
-        $this->setPullRequests($pullRequests);
27
-        $this->setApi($pullRequests->getApi());
28
-    }
19
+	/**
20
+	 * Constructor
21
+	 *
22
+	 * @param PullRequests $pullRequests
23
+	 */
24
+	public function __construct(PullRequests $pullRequests)
25
+	{
26
+		$this->setPullRequests($pullRequests);
27
+		$this->setApi($pullRequests->getApi());
28
+	}
29 29
 
30
-    /**
31
-     * Get pullRequests
32
-     *
33
-     * @return PullRequests
34
-     */
35
-    public function getPullRequests(): PullRequests
36
-    {
37
-        return $this->pullRequests;
38
-    }
30
+	/**
31
+	 * Get pullRequests
32
+	 *
33
+	 * @return PullRequests
34
+	 */
35
+	public function getPullRequests(): PullRequests
36
+	{
37
+		return $this->pullRequests;
38
+	}
39 39
 
40
-    /**
41
-     * Set pullRequests
42
-     *
43
-     * @param PullRequests $pullRequests
44
-     *
45
-     * @return AbstractPullRequests
46
-     */
47
-    public function setPullRequests(PullRequests $pullRequests): AbstractPullRequests
48
-    {
49
-        $this->pullRequests = $pullRequests;
40
+	/**
41
+	 * Set pullRequests
42
+	 *
43
+	 * @param PullRequests $pullRequests
44
+	 *
45
+	 * @return AbstractPullRequests
46
+	 */
47
+	public function setPullRequests(PullRequests $pullRequests): AbstractPullRequests
48
+	{
49
+		$this->pullRequests = $pullRequests;
50 50
 
51
-        return $this;
52
-    }
51
+		return $this;
52
+	}
53 53
 
54
-    /**
55
-     * Get api
56
-     *
57
-     * @return AbstractApi
58
-     */
59
-    public function getApi(): AbstractApi
60
-    {
61
-        return $this->api;
62
-    }
54
+	/**
55
+	 * Get api
56
+	 *
57
+	 * @return AbstractApi
58
+	 */
59
+	public function getApi(): AbstractApi
60
+	{
61
+		return $this->api;
62
+	}
63 63
 
64
-    /**
65
-     * Set api
66
-     *
67
-     * @param AbstractApi $api
68
-     *
69
-     * @return AbstractPullRequests
70
-     */
71
-    public function setApi(AbstractApi $api): AbstractPullRequests
72
-    {
73
-        $this->api = $api;
64
+	/**
65
+	 * Set api
66
+	 *
67
+	 * @param AbstractApi $api
68
+	 *
69
+	 * @return AbstractPullRequests
70
+	 */
71
+	public function setApi(AbstractApi $api): AbstractPullRequests
72
+	{
73
+		$this->api = $api;
74 74
 
75
-        return $this;
76
-    }
75
+		return $this;
76
+	}
77 77
 } 
78 78
\ No newline at end of file
Please login to merge, or discard this patch.
lib/GitHub/Receiver/PullRequests/ReviewComments.php 1 patch
Indentation   +115 added lines, -115 removed lines patch added patch discarded remove patch
@@ -14,126 +14,126 @@
 block discarded – undo
14 14
 class ReviewComments extends AbstractPullRequests
15 15
 {
16 16
 
17
-    /**
18
-     * List comments on a pull request
19
-     *
20
-     * @link https://developer.github.com/v3/pulls/comments/#list-comments-on-a-pull-request
21
-     *
22
-     * @param int $number
23
-     *
24
-     * @return array
25
-     * @throws \Exception
26
-     */
27
-    public function listCommentsPullRequest(int $number): array
28
-    {
29
-        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/pulls/:number/comments',
30
-            $this->getPullRequests()->getOwner(), $this->getPullRequests()->getRepo(), $number));
31
-    }
17
+	/**
18
+	 * List comments on a pull request
19
+	 *
20
+	 * @link https://developer.github.com/v3/pulls/comments/#list-comments-on-a-pull-request
21
+	 *
22
+	 * @param int $number
23
+	 *
24
+	 * @return array
25
+	 * @throws \Exception
26
+	 */
27
+	public function listCommentsPullRequest(int $number): array
28
+	{
29
+		return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/pulls/:number/comments',
30
+			$this->getPullRequests()->getOwner(), $this->getPullRequests()->getRepo(), $number));
31
+	}
32 32
 
33
-    /**
34
-     * List comments in a repository
35
-     *
36
-     * @link https://developer.github.com/v3/pulls/comments/#list-comments-in-a-repository
37
-     *
38
-     * @param string $sort
39
-     * @param string $direction
40
-     * @param string $since
41
-     *
42
-     * @return array
43
-     * @throws \Exception
44
-     */
45
-    public function listCommentsRepository(string $sort = AbstractApi::SORT_CREATED,
46
-                                           string $direction = AbstractApi::DIRECTION_DESC,
47
-                                           string $since = 'now'): array
48
-    {
49
-        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/pulls/comments?:args',
50
-            $this->getPullRequests()->getOwner(), $this->getPullRequests()->getRepo(), http_build_query([
51
-                'sort'      => $sort,
52
-                'direction' => $direction,
53
-                'since'     => (new DateTime($since))->format(DateTime::ATOM)
54
-            ])));
55
-    }
33
+	/**
34
+	 * List comments in a repository
35
+	 *
36
+	 * @link https://developer.github.com/v3/pulls/comments/#list-comments-in-a-repository
37
+	 *
38
+	 * @param string $sort
39
+	 * @param string $direction
40
+	 * @param string $since
41
+	 *
42
+	 * @return array
43
+	 * @throws \Exception
44
+	 */
45
+	public function listCommentsRepository(string $sort = AbstractApi::SORT_CREATED,
46
+										   string $direction = AbstractApi::DIRECTION_DESC,
47
+										   string $since = 'now'): array
48
+	{
49
+		return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/pulls/comments?:args',
50
+			$this->getPullRequests()->getOwner(), $this->getPullRequests()->getRepo(), http_build_query([
51
+				'sort'      => $sort,
52
+				'direction' => $direction,
53
+				'since'     => (new DateTime($since))->format(DateTime::ATOM)
54
+			])));
55
+	}
56 56
 
57
-    /**
58
-     * Get a single comment
59
-     *
60
-     * @link https://developer.github.com/v3/pulls/comments/#get-a-single-comment
61
-     *
62
-     * @param int $number
63
-     *
64
-     * @return array
65
-     * @throws \Exception
66
-     */
67
-    public function getSingleComment(int $number): array
68
-    {
69
-        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/pulls/comments/:number',
70
-            $this->getPullRequests()->getOwner(), $this->getPullRequests()->getRepo(), $number));
71
-    }
57
+	/**
58
+	 * Get a single comment
59
+	 *
60
+	 * @link https://developer.github.com/v3/pulls/comments/#get-a-single-comment
61
+	 *
62
+	 * @param int $number
63
+	 *
64
+	 * @return array
65
+	 * @throws \Exception
66
+	 */
67
+	public function getSingleComment(int $number): array
68
+	{
69
+		return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/pulls/comments/:number',
70
+			$this->getPullRequests()->getOwner(), $this->getPullRequests()->getRepo(), $number));
71
+	}
72 72
 
73
-    /**
74
-     * Create a comment
75
-     *
76
-     * @link https://developer.github.com/v3/pulls/comments/#create-a-comment
77
-     *
78
-     * @param int    $number
79
-     * @param string $body
80
-     * @param string $commitId
81
-     * @param string $path
82
-     * @param int    $position
83
-     *
84
-     * @return array
85
-     * @throws \Exception
86
-     */
87
-    public function createComment(int $number, string $body, string $commitId, string $path, int $position): array
88
-    {
89
-        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/pulls/:number/comments',
90
-            $this->getPullRequests()->getOwner(), $this->getPullRequests()->getRepo(), $number), Request::METHOD_POST, [
91
-                'body'      => $body,
92
-                'commit_id' => $commitId,
93
-                'path'      => $path,
94
-                'position'  => $position
95
-            ]);
96
-    }
73
+	/**
74
+	 * Create a comment
75
+	 *
76
+	 * @link https://developer.github.com/v3/pulls/comments/#create-a-comment
77
+	 *
78
+	 * @param int    $number
79
+	 * @param string $body
80
+	 * @param string $commitId
81
+	 * @param string $path
82
+	 * @param int    $position
83
+	 *
84
+	 * @return array
85
+	 * @throws \Exception
86
+	 */
87
+	public function createComment(int $number, string $body, string $commitId, string $path, int $position): array
88
+	{
89
+		return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/pulls/:number/comments',
90
+			$this->getPullRequests()->getOwner(), $this->getPullRequests()->getRepo(), $number), Request::METHOD_POST, [
91
+				'body'      => $body,
92
+				'commit_id' => $commitId,
93
+				'path'      => $path,
94
+				'position'  => $position
95
+			]);
96
+	}
97 97
 
98
-    /**
99
-     * Edit a comment
100
-     *
101
-     * @link https://developer.github.com/v3/pulls/comments/#edit-a-comment
102
-     *
103
-     * @param int    $number
104
-     * @param string $body
105
-     *
106
-     * @return array
107
-     * @throws \Exception
108
-     */
109
-    public function editComment(int $number, string $body): array
110
-    {
111
-        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/pulls/comments/:number',
112
-            $this->getPullRequests()->getOwner(), $this->getPullRequests()->getRepo(), $number), Request::METHOD_PATCH,
113
-            [
114
-                'body' => $body
115
-            ]);
116
-    }
98
+	/**
99
+	 * Edit a comment
100
+	 *
101
+	 * @link https://developer.github.com/v3/pulls/comments/#edit-a-comment
102
+	 *
103
+	 * @param int    $number
104
+	 * @param string $body
105
+	 *
106
+	 * @return array
107
+	 * @throws \Exception
108
+	 */
109
+	public function editComment(int $number, string $body): array
110
+	{
111
+		return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/pulls/comments/:number',
112
+			$this->getPullRequests()->getOwner(), $this->getPullRequests()->getRepo(), $number), Request::METHOD_PATCH,
113
+			[
114
+				'body' => $body
115
+			]);
116
+	}
117 117
 
118
-    /**
119
-     * Delete a comment
120
-     *
121
-     * @link https://developer.github.com/v3/pulls/comments/#delete-a-comment
122
-     *
123
-     * @param int $number
124
-     *
125
-     * @return bool
126
-     * @throws \Exception
127
-     */
128
-    public function deleteComment(int $number): bool
129
-    {
130
-        $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/pulls/comments/:number',
131
-            $this->getPullRequests()->getOwner(), $this->getPullRequests()->getRepo(), $number));
118
+	/**
119
+	 * Delete a comment
120
+	 *
121
+	 * @link https://developer.github.com/v3/pulls/comments/#delete-a-comment
122
+	 *
123
+	 * @param int $number
124
+	 *
125
+	 * @return bool
126
+	 * @throws \Exception
127
+	 */
128
+	public function deleteComment(int $number): bool
129
+	{
130
+		$this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/pulls/comments/:number',
131
+			$this->getPullRequests()->getOwner(), $this->getPullRequests()->getRepo(), $number));
132 132
 
133
-        if ($this->getApi()->getHeaders()['Status'] == '204 No Content') {
134
-            return true;
135
-        }
133
+		if ($this->getApi()->getHeaders()['Status'] == '204 No Content') {
134
+			return true;
135
+		}
136 136
 
137
-        return false;
138
-    }
137
+		return false;
138
+	}
139 139
 }
140 140
\ No newline at end of file
Please login to merge, or discard this patch.
lib/GitHub/Receiver/Repositories/Comments.php 1 patch
Indentation   +94 added lines, -94 removed lines patch added patch discarded remove patch
@@ -12,103 +12,103 @@
 block discarded – undo
12 12
 class Comments extends AbstractRepositories
13 13
 {
14 14
 
15
-    /**
16
-     * List commit comments for a repository
17
-     *
18
-     * @link https://developer.github.com/v3/repos/comments/#list-commit-comments-for-a-repository
19
-     * @return array
20
-     */
21
-    public function listComments(): array
22
-    {
23
-        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/comments',
24
-            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo()));
25
-    }
15
+	/**
16
+	 * List commit comments for a repository
17
+	 *
18
+	 * @link https://developer.github.com/v3/repos/comments/#list-commit-comments-for-a-repository
19
+	 * @return array
20
+	 */
21
+	public function listComments(): array
22
+	{
23
+		return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/comments',
24
+			$this->getRepositories()->getOwner(), $this->getRepositories()->getRepo()));
25
+	}
26 26
 
27
-    /**
28
-     * List comments for a single commit
29
-     *
30
-     * @link https://developer.github.com/v3/repos/comments/#list-comments-for-a-single-commit
31
-     *
32
-     * @param string $ref
33
-     *
34
-     * @return array
35
-     */
36
-    public function listCommitComments(string $ref): array
37
-    {
38
-        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/commits/:ref/comments',
39
-            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), $ref));
40
-    }
27
+	/**
28
+	 * List comments for a single commit
29
+	 *
30
+	 * @link https://developer.github.com/v3/repos/comments/#list-comments-for-a-single-commit
31
+	 *
32
+	 * @param string $ref
33
+	 *
34
+	 * @return array
35
+	 */
36
+	public function listCommitComments(string $ref): array
37
+	{
38
+		return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/commits/:ref/comments',
39
+			$this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), $ref));
40
+	}
41 41
 
42
-    /**
43
-     * Create a commit comment
44
-     *
45
-     * @link https://developer.github.com/v3/repos/comments/#create-a-commit-comment
46
-     *
47
-     * @param string $sha
48
-     * @param string $body
49
-     * @param string $path
50
-     * @param int    $position
51
-     *
52
-     * @return array
53
-     */
54
-    public function addCommitComment(string $sha, string $body, string $path = '', int $position = 0): array
55
-    {
56
-        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/commits/:sha/comments',
57
-            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), $sha), Request::METHOD_POST, [
58
-                'body'     => $body,
59
-                'path'     => $path,
60
-                'position' => $position
61
-            ]);
62
-    }
42
+	/**
43
+	 * Create a commit comment
44
+	 *
45
+	 * @link https://developer.github.com/v3/repos/comments/#create-a-commit-comment
46
+	 *
47
+	 * @param string $sha
48
+	 * @param string $body
49
+	 * @param string $path
50
+	 * @param int    $position
51
+	 *
52
+	 * @return array
53
+	 */
54
+	public function addCommitComment(string $sha, string $body, string $path = '', int $position = 0): array
55
+	{
56
+		return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/commits/:sha/comments',
57
+			$this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), $sha), Request::METHOD_POST, [
58
+				'body'     => $body,
59
+				'path'     => $path,
60
+				'position' => $position
61
+			]);
62
+	}
63 63
 
64
-    /**
65
-     * Get a single commit comment
66
-     *
67
-     * @link https://developer.github.com/v3/repos/comments/#get-a-single-commit-comment
68
-     *
69
-     * @param int $id
70
-     *
71
-     * @return array
72
-     */
73
-    public function getCommitComment(int $id): array
74
-    {
75
-        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/comments/:id',
76
-            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), (string)$id));
77
-    }
64
+	/**
65
+	 * Get a single commit comment
66
+	 *
67
+	 * @link https://developer.github.com/v3/repos/comments/#get-a-single-commit-comment
68
+	 *
69
+	 * @param int $id
70
+	 *
71
+	 * @return array
72
+	 */
73
+	public function getCommitComment(int $id): array
74
+	{
75
+		return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/comments/:id',
76
+			$this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), (string)$id));
77
+	}
78 78
 
79
-    /**
80
-     * Update a commit comment
81
-     *
82
-     * @link https://developer.github.com/v3/repos/comments/#update-a-commit-comment
83
-     *
84
-     * @param int    $id
85
-     * @param string $body
86
-     *
87
-     * @return array
88
-     * @throws \Exception
89
-     */
90
-    public function updateCommitComment(int $id, string $body): array
91
-    {
92
-        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/comments/:id',
93
-            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), (string)$id),
94
-            Request::METHOD_PATCH, [
95
-                'body' => $body
96
-            ]);
97
-    }
79
+	/**
80
+	 * Update a commit comment
81
+	 *
82
+	 * @link https://developer.github.com/v3/repos/comments/#update-a-commit-comment
83
+	 *
84
+	 * @param int    $id
85
+	 * @param string $body
86
+	 *
87
+	 * @return array
88
+	 * @throws \Exception
89
+	 */
90
+	public function updateCommitComment(int $id, string $body): array
91
+	{
92
+		return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/comments/:id',
93
+			$this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), (string)$id),
94
+			Request::METHOD_PATCH, [
95
+				'body' => $body
96
+			]);
97
+	}
98 98
 
99
-    /**
100
-     * Delete a commit comment
101
-     *
102
-     * @link https://developer.github.com/v3/repos/comments/#delete-a-commit-comment
103
-     *
104
-     * @param int $id
105
-     *
106
-     * @return array
107
-     */
108
-    public function deleteCommitComment(int $id): array
109
-    {
110
-        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/comments/:id',
111
-            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), (string)$id),
112
-            Request::METHOD_DELETE);
113
-    }
99
+	/**
100
+	 * Delete a commit comment
101
+	 *
102
+	 * @link https://developer.github.com/v3/repos/comments/#delete-a-commit-comment
103
+	 *
104
+	 * @param int $id
105
+	 *
106
+	 * @return array
107
+	 */
108
+	public function deleteCommitComment(int $id): array
109
+	{
110
+		return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/comments/:id',
111
+			$this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), (string)$id),
112
+			Request::METHOD_DELETE);
113
+	}
114 114
 } 
115 115
\ No newline at end of file
Please login to merge, or discard this patch.
lib/GitHub/Receiver/Repositories/Forks.php 1 patch
Indentation   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -13,35 +13,35 @@
 block discarded – undo
13 13
 class Forks extends AbstractRepositories
14 14
 {
15 15
 
16
-    /**
17
-     * List forks
18
-     *
19
-     * @link https://developer.github.com/v3/repos/forks/#list-forks
20
-     *
21
-     * @param string $sort
22
-     *
23
-     * @return array
24
-     */
25
-    public function listForks(string $sort = AbstractApi::SORT_NEWEST): array
26
-    {
27
-        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/forks?:arg',
28
-            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(),
29
-            http_build_query(['sort' => $sort])));
30
-    }
16
+	/**
17
+	 * List forks
18
+	 *
19
+	 * @link https://developer.github.com/v3/repos/forks/#list-forks
20
+	 *
21
+	 * @param string $sort
22
+	 *
23
+	 * @return array
24
+	 */
25
+	public function listForks(string $sort = AbstractApi::SORT_NEWEST): array
26
+	{
27
+		return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/forks?:arg',
28
+			$this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(),
29
+			http_build_query(['sort' => $sort])));
30
+	}
31 31
 
32
-    /**
33
-     * Create a fork
34
-     *
35
-     * @link https://developer.github.com/v3/repos/forks/#create-a-fork
36
-     *
37
-     * @param string $organization
38
-     *
39
-     * @return array
40
-     */
41
-    public function createFork(string $organization = ''): array
42
-    {
43
-        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/forks',
44
-            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo()), Request::METHOD_POST,
45
-            ['organization' => $organization]);
46
-    }
32
+	/**
33
+	 * Create a fork
34
+	 *
35
+	 * @link https://developer.github.com/v3/repos/forks/#create-a-fork
36
+	 *
37
+	 * @param string $organization
38
+	 *
39
+	 * @return array
40
+	 */
41
+	public function createFork(string $organization = ''): array
42
+	{
43
+		return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/forks',
44
+			$this->getRepositories()->getOwner(), $this->getRepositories()->getRepo()), Request::METHOD_POST,
45
+			['organization' => $organization]);
46
+	}
47 47
 } 
48 48
\ No newline at end of file
Please login to merge, or discard this patch.
lib/GitHub/Receiver/Repositories/DeployKeys.php 1 patch
Indentation   +59 added lines, -59 removed lines patch added patch discarded remove patch
@@ -12,66 +12,66 @@
 block discarded – undo
12 12
 class DeployKeys extends AbstractRepositories
13 13
 {
14 14
 
15
-    /**
16
-     * List deploy keys
17
-     *
18
-     * @link https://developer.github.com/v3/repos/keys/#list
19
-     * @return array
20
-     */
21
-    public function listDeployKeys(): array
22
-    {
23
-        return $this->getApi()->request($this->getApi()
24
-                                             ->sprintf('/repos/:owner/:repo/keys', $this->getRepositories()->getOwner(),
25
-                                                 $this->getRepositories()->getRepo()));
26
-    }
15
+	/**
16
+	 * List deploy keys
17
+	 *
18
+	 * @link https://developer.github.com/v3/repos/keys/#list
19
+	 * @return array
20
+	 */
21
+	public function listDeployKeys(): array
22
+	{
23
+		return $this->getApi()->request($this->getApi()
24
+											 ->sprintf('/repos/:owner/:repo/keys', $this->getRepositories()->getOwner(),
25
+												 $this->getRepositories()->getRepo()));
26
+	}
27 27
 
28
-    /**
29
-     * Get a deploy key
30
-     *
31
-     * @link https://developer.github.com/v3/repos/keys/#get
32
-     *
33
-     * @param int $id
34
-     *
35
-     * @return array
36
-     */
37
-    public function getDeployKey(int $id): array
38
-    {
39
-        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/keys/:id',
40
-            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), $id));
41
-    }
28
+	/**
29
+	 * Get a deploy key
30
+	 *
31
+	 * @link https://developer.github.com/v3/repos/keys/#get
32
+	 *
33
+	 * @param int $id
34
+	 *
35
+	 * @return array
36
+	 */
37
+	public function getDeployKey(int $id): array
38
+	{
39
+		return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/keys/:id',
40
+			$this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), $id));
41
+	}
42 42
 
43
-    /**
44
-     * Add a new deploy key
45
-     *
46
-     * @link https://developer.github.com/v3/repos/keys/#create
47
-     *
48
-     * @param string $title
49
-     * @param string $key
50
-     *
51
-     * @return array
52
-     */
53
-    public function addNewDeployKey(string $title, string $key): array
54
-    {
55
-        return $this->getApi()->request($this->getApi()
56
-                                             ->sprintf('/repos/:owner/:repo/keys', $this->getRepositories()->getOwner(),
57
-                                                 $this->getRepositories()->getRepo()), Request::METHOD_POST, [
58
-                'title' => $title,
59
-                'key'   => $key
60
-            ]);
61
-    }
43
+	/**
44
+	 * Add a new deploy key
45
+	 *
46
+	 * @link https://developer.github.com/v3/repos/keys/#create
47
+	 *
48
+	 * @param string $title
49
+	 * @param string $key
50
+	 *
51
+	 * @return array
52
+	 */
53
+	public function addNewDeployKey(string $title, string $key): array
54
+	{
55
+		return $this->getApi()->request($this->getApi()
56
+											 ->sprintf('/repos/:owner/:repo/keys', $this->getRepositories()->getOwner(),
57
+												 $this->getRepositories()->getRepo()), Request::METHOD_POST, [
58
+				'title' => $title,
59
+				'key'   => $key
60
+			]);
61
+	}
62 62
 
63
-    /**
64
-     * Remove a deploy key
65
-     *
66
-     * @link https://developer.github.com/v3/repos/keys/#delete
67
-     *
68
-     * @param int $id
69
-     *
70
-     * @return array
71
-     */
72
-    public function removeDeployKey(int $id): array
73
-    {
74
-        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/keys/:id',
75
-            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), $id), Request::METHOD_DELETE);
76
-    }
63
+	/**
64
+	 * Remove a deploy key
65
+	 *
66
+	 * @link https://developer.github.com/v3/repos/keys/#delete
67
+	 *
68
+	 * @param int $id
69
+	 *
70
+	 * @return array
71
+	 */
72
+	public function removeDeployKey(int $id): array
73
+	{
74
+		return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/keys/:id',
75
+			$this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), $id), Request::METHOD_DELETE);
76
+	}
77 77
 } 
78 78
\ No newline at end of file
Please login to merge, or discard this patch.
lib/GitHub/Receiver/Repositories/Statuses.php 1 patch
Indentation   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -12,58 +12,58 @@
 block discarded – undo
12 12
 class Statuses extends AbstractRepositories
13 13
 {
14 14
 
15
-    /**
16
-     * Create a Status
17
-     *
18
-     * @link https://developer.github.com/v3/repos/statuses/#create-a-status
19
-     *
20
-     * @param string $sha
21
-     * @param string $state
22
-     * @param string $targetUrl
23
-     * @param string $description
24
-     * @param string $context
25
-     *
26
-     * @return array
27
-     */
28
-    public function createStatus(string $sha, string $state, string $targetUrl = null, string $description = null,
29
-                                 string $context = 'default'): array
30
-    {
31
-        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/statuses/:sha',
32
-            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), $sha), Request::METHOD_POST, [
33
-                'state'       => $state,
34
-                'target_url'  => $targetUrl,
35
-                'description' => $description,
36
-                'context'     => $context
37
-            ]);
38
-    }
15
+	/**
16
+	 * Create a Status
17
+	 *
18
+	 * @link https://developer.github.com/v3/repos/statuses/#create-a-status
19
+	 *
20
+	 * @param string $sha
21
+	 * @param string $state
22
+	 * @param string $targetUrl
23
+	 * @param string $description
24
+	 * @param string $context
25
+	 *
26
+	 * @return array
27
+	 */
28
+	public function createStatus(string $sha, string $state, string $targetUrl = null, string $description = null,
29
+								 string $context = 'default'): array
30
+	{
31
+		return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/statuses/:sha',
32
+			$this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), $sha), Request::METHOD_POST, [
33
+				'state'       => $state,
34
+				'target_url'  => $targetUrl,
35
+				'description' => $description,
36
+				'context'     => $context
37
+			]);
38
+	}
39 39
 
40
-    /**
41
-     * List Statuses for a specific Ref
42
-     *
43
-     * @link https://developer.github.com/v3/repos/statuses/#list-statuses-for-a-specific-ref
44
-     *
45
-     * @param string $ref
46
-     *
47
-     * @return array
48
-     */
49
-    public function listStatuses(string $ref): array
50
-    {
51
-        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/commits/:ref/statuses',
52
-            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), $ref));
53
-    }
40
+	/**
41
+	 * List Statuses for a specific Ref
42
+	 *
43
+	 * @link https://developer.github.com/v3/repos/statuses/#list-statuses-for-a-specific-ref
44
+	 *
45
+	 * @param string $ref
46
+	 *
47
+	 * @return array
48
+	 */
49
+	public function listStatuses(string $ref): array
50
+	{
51
+		return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/commits/:ref/statuses',
52
+			$this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), $ref));
53
+	}
54 54
 
55
-    /**
56
-     * Get the combined Status for a specific Ref
57
-     *
58
-     * @link https://developer.github.com/v3/repos/statuses/#get-the-combined-status-for-a-specific-ref
59
-     *
60
-     * @param string $ref
61
-     *
62
-     * @return array
63
-     */
64
-    public function getCombinedStatus(string $ref): array
65
-    {
66
-        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/commits/:ref/status',
67
-            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), $ref));
68
-    }
55
+	/**
56
+	 * Get the combined Status for a specific Ref
57
+	 *
58
+	 * @link https://developer.github.com/v3/repos/statuses/#get-the-combined-status-for-a-specific-ref
59
+	 *
60
+	 * @param string $ref
61
+	 *
62
+	 * @return array
63
+	 */
64
+	public function getCombinedStatus(string $ref): array
65
+	{
66
+		return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/commits/:ref/status',
67
+			$this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), $ref));
68
+	}
69 69
 } 
70 70
\ No newline at end of file
Please login to merge, or discard this patch.
lib/GitHub/Receiver/Repositories/Commits.php 1 patch
Indentation   +54 added lines, -54 removed lines patch added patch discarded remove patch
@@ -12,60 +12,60 @@
 block discarded – undo
12 12
 class Commits extends AbstractRepositories
13 13
 {
14 14
 
15
-    /**
16
-     * List commits on a repository
17
-     *
18
-     * @link https://developer.github.com/v3/repos/commits/#list-commits-on-a-repository
19
-     *
20
-     * @param string      $sha
21
-     * @param string|null $path
22
-     * @param string|null $author
23
-     * @param string|null $since
24
-     * @param string|null $until
25
-     *
26
-     * @return array
27
-     */
28
-    public function listCommits(string $sha = AbstractApi::BRANCH_MASTER, string $path = null, string $author = null,
29
-                                string $since = null, string $until = null): array
30
-    {
31
-        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/commits?:args',
32
-            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), http_build_query([
33
-                "sha"    => $sha,
34
-                "path"   => $path,
35
-                "author" => $author,
36
-                "since"  => $since,
37
-                "until"  => $until
38
-            ])));
39
-    }
15
+	/**
16
+	 * List commits on a repository
17
+	 *
18
+	 * @link https://developer.github.com/v3/repos/commits/#list-commits-on-a-repository
19
+	 *
20
+	 * @param string      $sha
21
+	 * @param string|null $path
22
+	 * @param string|null $author
23
+	 * @param string|null $since
24
+	 * @param string|null $until
25
+	 *
26
+	 * @return array
27
+	 */
28
+	public function listCommits(string $sha = AbstractApi::BRANCH_MASTER, string $path = null, string $author = null,
29
+								string $since = null, string $until = null): array
30
+	{
31
+		return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/commits?:args',
32
+			$this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), http_build_query([
33
+				"sha"    => $sha,
34
+				"path"   => $path,
35
+				"author" => $author,
36
+				"since"  => $since,
37
+				"until"  => $until
38
+			])));
39
+	}
40 40
 
41
-    /**
42
-     * Get a single commit
43
-     *
44
-     * @link https://developer.github.com/v3/repos/commits/#get-a-single-commit
45
-     *
46
-     * @param string $sha
47
-     *
48
-     * @return array
49
-     */
50
-    public function getSingleCommit(string $sha): array
51
-    {
52
-        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/commits/:sha',
53
-            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), $sha));
54
-    }
41
+	/**
42
+	 * Get a single commit
43
+	 *
44
+	 * @link https://developer.github.com/v3/repos/commits/#get-a-single-commit
45
+	 *
46
+	 * @param string $sha
47
+	 *
48
+	 * @return array
49
+	 */
50
+	public function getSingleCommit(string $sha): array
51
+	{
52
+		return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/commits/:sha',
53
+			$this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), $sha));
54
+	}
55 55
 
56
-    /**
57
-     * Compare two commits
58
-     *
59
-     * @link https://developer.github.com/v3/repos/commits/#compare-two-commits
60
-     *
61
-     * @param string $base
62
-     * @param string $head
63
-     *
64
-     * @return array
65
-     */
66
-    public function compareTwoCommits(string $base, string $head): array
67
-    {
68
-        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/compare/:base...:head',
69
-            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), $base, $head));
70
-    }
56
+	/**
57
+	 * Compare two commits
58
+	 *
59
+	 * @link https://developer.github.com/v3/repos/commits/#compare-two-commits
60
+	 *
61
+	 * @param string $base
62
+	 * @param string $head
63
+	 *
64
+	 * @return array
65
+	 */
66
+	public function compareTwoCommits(string $base, string $head): array
67
+	{
68
+		return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/compare/:base...:head',
69
+			$this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), $base, $head));
70
+	}
71 71
 } 
Please login to merge, or discard this patch.