Passed
Push — 1.1 ( 616134...803478 )
by David
03:36
created
lib/GitHub/Receiver/Repositories/Collaborators.php 1 patch
Indentation   +58 added lines, -58 removed lines patch added patch discarded remove patch
@@ -12,67 +12,67 @@
 block discarded – undo
12 12
 class Collaborators extends AbstractRepositories
13 13
 {
14 14
 
15
-    /**
16
-     * List collaborators
17
-     *
18
-     * @link https://developer.github.com/v3/repos/collaborators/#list
19
-     * @return array
20
-     */
21
-    public function listCollaborators(): array
22
-    {
23
-        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/collaborators',
24
-            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo()));
25
-    }
15
+	/**
16
+	 * List collaborators
17
+	 *
18
+	 * @link https://developer.github.com/v3/repos/collaborators/#list
19
+	 * @return array
20
+	 */
21
+	public function listCollaborators(): array
22
+	{
23
+		return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/collaborators',
24
+			$this->getRepositories()->getOwner(), $this->getRepositories()->getRepo()));
25
+	}
26 26
 
27
-    /**
28
-     * Check if a user is a collaborator
29
-     *
30
-     * @link https://developer.github.com/v3/repos/collaborators/#get
31
-     *
32
-     * @param string $username
33
-     *
34
-     * @return bool
35
-     */
36
-    public function checkUserIsACollaborator(string $username): bool
37
-    {
38
-        $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/collaborators/:username',
39
-            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), $username));
27
+	/**
28
+	 * Check if a user is a collaborator
29
+	 *
30
+	 * @link https://developer.github.com/v3/repos/collaborators/#get
31
+	 *
32
+	 * @param string $username
33
+	 *
34
+	 * @return bool
35
+	 */
36
+	public function checkUserIsACollaborator(string $username): bool
37
+	{
38
+		$this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/collaborators/:username',
39
+			$this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), $username));
40 40
 
41
-        if ($this->getApi()->getHeaders()['Status'] == '204 No Content') {
42
-            return true;
43
-        }
41
+		if ($this->getApi()->getHeaders()['Status'] == '204 No Content') {
42
+			return true;
43
+		}
44 44
 
45
-        return false;
46
-    }
45
+		return false;
46
+	}
47 47
 
48
-    /**
49
-     * Add user as a collaborator
50
-     *
51
-     * @link https://developer.github.com/v3/repos/collaborators/#add-collaborator
52
-     *
53
-     * @param string $username
54
-     *
55
-     * @return array
56
-     */
57
-    public function addUserAsCollaborator(string $username): array
58
-    {
59
-        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/collaborators/:username',
60
-            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), $username), Request::METHOD_PUT);
61
-    }
48
+	/**
49
+	 * Add user as a collaborator
50
+	 *
51
+	 * @link https://developer.github.com/v3/repos/collaborators/#add-collaborator
52
+	 *
53
+	 * @param string $username
54
+	 *
55
+	 * @return array
56
+	 */
57
+	public function addUserAsCollaborator(string $username): array
58
+	{
59
+		return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/collaborators/:username',
60
+			$this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), $username), Request::METHOD_PUT);
61
+	}
62 62
 
63
-    /**
64
-     * Remove user as a collaborator
65
-     *
66
-     * @link https://developer.github.com/v3/repos/collaborators/#remove-collaborator
67
-     *
68
-     * @param string $username
69
-     *
70
-     * @return array
71
-     */
72
-    public function removeUserAsCollaborator(string $username): array
73
-    {
74
-        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/collaborators/:username',
75
-            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), $username),
76
-            Request::METHOD_DELETE);
77
-    }
63
+	/**
64
+	 * Remove user as a collaborator
65
+	 *
66
+	 * @link https://developer.github.com/v3/repos/collaborators/#remove-collaborator
67
+	 *
68
+	 * @param string $username
69
+	 *
70
+	 * @return array
71
+	 */
72
+	public function removeUserAsCollaborator(string $username): array
73
+	{
74
+		return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/collaborators/:username',
75
+			$this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), $username),
76
+			Request::METHOD_DELETE);
77
+	}
78 78
 } 
79 79
\ No newline at end of file
Please login to merge, or discard this patch.
lib/GitHub/Receiver/Repositories/AbstractRepositories.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 AbstractRepositories
13 13
 {
14 14
 
15
-    /** Properties */
16
-    protected $repositories;
17
-    protected $api;
15
+	/** Properties */
16
+	protected $repositories;
17
+	protected $api;
18 18
 
19
-    /**
20
-     * Constructor
21
-     *
22
-     * @param Repositories $repositories
23
-     */
24
-    public function __construct(Repositories $repositories)
25
-    {
26
-        $this->setRepositories($repositories);
27
-        $this->setApi($repositories->getApi());
28
-    }
19
+	/**
20
+	 * Constructor
21
+	 *
22
+	 * @param Repositories $repositories
23
+	 */
24
+	public function __construct(Repositories $repositories)
25
+	{
26
+		$this->setRepositories($repositories);
27
+		$this->setApi($repositories->getApi());
28
+	}
29 29
 
30
-    /**
31
-     * Get repositories
32
-     *
33
-     * @return Repositories
34
-     */
35
-    public function getRepositories(): Repositories
36
-    {
37
-        return $this->repositories;
38
-    }
30
+	/**
31
+	 * Get repositories
32
+	 *
33
+	 * @return Repositories
34
+	 */
35
+	public function getRepositories(): Repositories
36
+	{
37
+		return $this->repositories;
38
+	}
39 39
 
40
-    /**
41
-     * Set repositories
42
-     *
43
-     * @param Repositories $repositories
44
-     *
45
-     * @return AbstractRepositories
46
-     */
47
-    public function setRepositories(Repositories $repositories): AbstractRepositories
48
-    {
49
-        $this->repositories = $repositories;
40
+	/**
41
+	 * Set repositories
42
+	 *
43
+	 * @param Repositories $repositories
44
+	 *
45
+	 * @return AbstractRepositories
46
+	 */
47
+	public function setRepositories(Repositories $repositories): AbstractRepositories
48
+	{
49
+		$this->repositories = $repositories;
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 AbstractRepositories
70
-     */
71
-    public function setApi(AbstractApi $api): AbstractRepositories
72
-    {
73
-        $this->api = $api;
64
+	/**
65
+	 * Set api
66
+	 *
67
+	 * @param AbstractApi $api
68
+	 *
69
+	 * @return AbstractRepositories
70
+	 */
71
+	public function setApi(AbstractApi $api): AbstractRepositories
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/Repositories/Deployments.php 1 patch
Indentation   +86 added lines, -86 removed lines patch added patch discarded remove patch
@@ -13,93 +13,93 @@
 block discarded – undo
13 13
 class Deployments extends AbstractRepositories
14 14
 {
15 15
 
16
-    /**
17
-     * List Deployments
18
-     *
19
-     * @link https://developer.github.com/v3/repos/deployments/#list-deployments
20
-     *
21
-     * @param string $sha
22
-     * @param string $ref
23
-     * @param string $task
24
-     * @param string $environment
25
-     *
26
-     * @return array
27
-     */
28
-    public function listDeployments(string $sha = null, string $ref = null, string $task = null,
29
-                                    string $environment = null): array
30
-    {
31
-        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/deployments',
32
-            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(),
33
-            http_build_query(['sha' => $sha, 'ref' => $ref, 'task' => $task, 'environment' => $environment])));
34
-    }
16
+	/**
17
+	 * List Deployments
18
+	 *
19
+	 * @link https://developer.github.com/v3/repos/deployments/#list-deployments
20
+	 *
21
+	 * @param string $sha
22
+	 * @param string $ref
23
+	 * @param string $task
24
+	 * @param string $environment
25
+	 *
26
+	 * @return array
27
+	 */
28
+	public function listDeployments(string $sha = null, string $ref = null, string $task = null,
29
+									string $environment = null): array
30
+	{
31
+		return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/deployments',
32
+			$this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(),
33
+			http_build_query(['sha' => $sha, 'ref' => $ref, 'task' => $task, 'environment' => $environment])));
34
+	}
35 35
 
36
-    /**
37
-     * Create a Deployment
38
-     *
39
-     * @link https://developer.github.com/v3/repos/deployments/#create-a-deployment
40
-     *
41
-     * @param string $ref
42
-     * @param string $task
43
-     * @param bool   $autoMerge
44
-     * @param array  $requiredContexts
45
-     * @param string $payload
46
-     * @param string $environment
47
-     * @param string $description
48
-     *
49
-     * @return array
50
-     */
51
-    public function createDeployement(string $ref, string $task = AbstractApi::TASK_DEPLOY, bool $autoMerge = true,
52
-                                      array $requiredContexts = [], string $payload = '',
53
-                                      string $environment = AbstractApi::ENVIRONMENT_PRODUCTION,
54
-                                      string $description = ''): array
55
-    {
56
-        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/deployments',
57
-            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo()), Request::METHOD_POST, [
58
-                'ref'               => $ref,
59
-                'task'              => $task,
60
-                'auto_merge'        => $autoMerge,
61
-                'required_contexts' => $requiredContexts,
62
-                'payload'           => $payload,
63
-                'environment'       => $environment,
64
-                'description'       => $description
65
-            ]);
66
-    }
36
+	/**
37
+	 * Create a Deployment
38
+	 *
39
+	 * @link https://developer.github.com/v3/repos/deployments/#create-a-deployment
40
+	 *
41
+	 * @param string $ref
42
+	 * @param string $task
43
+	 * @param bool   $autoMerge
44
+	 * @param array  $requiredContexts
45
+	 * @param string $payload
46
+	 * @param string $environment
47
+	 * @param string $description
48
+	 *
49
+	 * @return array
50
+	 */
51
+	public function createDeployement(string $ref, string $task = AbstractApi::TASK_DEPLOY, bool $autoMerge = true,
52
+									  array $requiredContexts = [], string $payload = '',
53
+									  string $environment = AbstractApi::ENVIRONMENT_PRODUCTION,
54
+									  string $description = ''): array
55
+	{
56
+		return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/deployments',
57
+			$this->getRepositories()->getOwner(), $this->getRepositories()->getRepo()), Request::METHOD_POST, [
58
+				'ref'               => $ref,
59
+				'task'              => $task,
60
+				'auto_merge'        => $autoMerge,
61
+				'required_contexts' => $requiredContexts,
62
+				'payload'           => $payload,
63
+				'environment'       => $environment,
64
+				'description'       => $description
65
+			]);
66
+	}
67 67
 
68
-    /**
69
-     * List Deployment Statuses
70
-     *
71
-     * @link https://developer.github.com/v3/repos/deployments/#list-deployment-statuses
72
-     *
73
-     * @param int $id
74
-     *
75
-     * @return array
76
-     */
77
-    public function listDeploymentStatus(int $id): array
78
-    {
79
-        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/deployments/:id/statuses',
80
-            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), $id));
81
-    }
68
+	/**
69
+	 * List Deployment Statuses
70
+	 *
71
+	 * @link https://developer.github.com/v3/repos/deployments/#list-deployment-statuses
72
+	 *
73
+	 * @param int $id
74
+	 *
75
+	 * @return array
76
+	 */
77
+	public function listDeploymentStatus(int $id): array
78
+	{
79
+		return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/deployments/:id/statuses',
80
+			$this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), $id));
81
+	}
82 82
 
83
-    /**
84
-     * Create a Deployment Status
85
-     *
86
-     * @link https://developer.github.com/v3/repos/deployments/#create-a-deployment-status
87
-     *
88
-     * @param int    $id
89
-     * @param string $state
90
-     * @param string $targetUrl
91
-     * @param string $description
92
-     *
93
-     * @return array
94
-     */
95
-    public function createDeploymentStatus(int $id, string $state, string $targetUrl = '',
96
-                                           string $description = ''): array
97
-    {
98
-        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/deployments/:id/statuses',
99
-            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), $id), Request::METHOD_POST, [
100
-                'state'       => $state,
101
-                'target_url'  => $targetUrl,
102
-                'description' => $description
103
-            ]);
104
-    }
83
+	/**
84
+	 * Create a Deployment Status
85
+	 *
86
+	 * @link https://developer.github.com/v3/repos/deployments/#create-a-deployment-status
87
+	 *
88
+	 * @param int    $id
89
+	 * @param string $state
90
+	 * @param string $targetUrl
91
+	 * @param string $description
92
+	 *
93
+	 * @return array
94
+	 */
95
+	public function createDeploymentStatus(int $id, string $state, string $targetUrl = '',
96
+										   string $description = ''): array
97
+	{
98
+		return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/deployments/:id/statuses',
99
+			$this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), $id), Request::METHOD_POST, [
100
+				'state'       => $state,
101
+				'target_url'  => $targetUrl,
102
+				'description' => $description
103
+			]);
104
+	}
105 105
 } 
106 106
\ No newline at end of file
Please login to merge, or discard this patch.
lib/GitHub/Receiver/Repositories/Statistics.php 1 patch
Indentation   +55 added lines, -55 removed lines patch added patch discarded remove patch
@@ -10,63 +10,63 @@
 block discarded – undo
10 10
 class Statistics extends AbstractRepositories
11 11
 {
12 12
 
13
-    /**
14
-     * Get contributors list with additions, deletions, and commit counts
15
-     *
16
-     * @link https://developer.github.com/v3/repos/statistics/#contributors
17
-     * @return array
18
-     */
19
-    public function listContributors(): array
20
-    {
21
-        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/stats/contributors',
22
-            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo()));
23
-    }
13
+	/**
14
+	 * Get contributors list with additions, deletions, and commit counts
15
+	 *
16
+	 * @link https://developer.github.com/v3/repos/statistics/#contributors
17
+	 * @return array
18
+	 */
19
+	public function listContributors(): array
20
+	{
21
+		return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/stats/contributors',
22
+			$this->getRepositories()->getOwner(), $this->getRepositories()->getRepo()));
23
+	}
24 24
 
25
-    /**
26
-     * Get the last year of commit activity data
27
-     *
28
-     * @link https://developer.github.com/v3/repos/statistics/#commit-activity
29
-     * @return array
30
-     */
31
-    public function getCommitActivity(): array
32
-    {
33
-        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/stats/commit_activity',
34
-            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo()));
35
-    }
25
+	/**
26
+	 * Get the last year of commit activity data
27
+	 *
28
+	 * @link https://developer.github.com/v3/repos/statistics/#commit-activity
29
+	 * @return array
30
+	 */
31
+	public function getCommitActivity(): array
32
+	{
33
+		return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/stats/commit_activity',
34
+			$this->getRepositories()->getOwner(), $this->getRepositories()->getRepo()));
35
+	}
36 36
 
37
-    /**
38
-     * Get the number of additions and deletions per week
39
-     *
40
-     * @link https://developer.github.com/v3/repos/statistics/#code-frequency
41
-     * @return array
42
-     */
43
-    public function getCodeFrequency(): array
44
-    {
45
-        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/stats/code_frequency',
46
-            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo()));
47
-    }
37
+	/**
38
+	 * Get the number of additions and deletions per week
39
+	 *
40
+	 * @link https://developer.github.com/v3/repos/statistics/#code-frequency
41
+	 * @return array
42
+	 */
43
+	public function getCodeFrequency(): array
44
+	{
45
+		return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/stats/code_frequency',
46
+			$this->getRepositories()->getOwner(), $this->getRepositories()->getRepo()));
47
+	}
48 48
 
49
-    /**
50
-     * Get the weekly commit count for the repository owner and everyone else
51
-     *
52
-     * @link https://developer.github.com/v3/repos/statistics/#participation
53
-     * @return array
54
-     */
55
-    public function getParticipation(): array
56
-    {
57
-        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/stats/participation',
58
-            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo()));
59
-    }
49
+	/**
50
+	 * Get the weekly commit count for the repository owner and everyone else
51
+	 *
52
+	 * @link https://developer.github.com/v3/repos/statistics/#participation
53
+	 * @return array
54
+	 */
55
+	public function getParticipation(): array
56
+	{
57
+		return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/stats/participation',
58
+			$this->getRepositories()->getOwner(), $this->getRepositories()->getRepo()));
59
+	}
60 60
 
61
-    /**
62
-     * Get the number of commits per hour in each day
63
-     *
64
-     * @link https://developer.github.com/v3/repos/statistics/#punch-card
65
-     * @return array
66
-     */
67
-    public function getPunchCard(): array
68
-    {
69
-        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/stats/punch_card',
70
-            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo()));
71
-    }
61
+	/**
62
+	 * Get the number of commits per hour in each day
63
+	 *
64
+	 * @link https://developer.github.com/v3/repos/statistics/#punch-card
65
+	 * @return array
66
+	 */
67
+	public function getPunchCard(): array
68
+	{
69
+		return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/stats/punch_card',
70
+			$this->getRepositories()->getOwner(), $this->getRepositories()->getRepo()));
71
+	}
72 72
 }
73 73
\ No newline at end of file
Please login to merge, or discard this patch.
lib/GitHub/Receiver/Repositories/Hooks.php 1 patch
Indentation   +115 added lines, -115 removed lines patch added patch discarded remove patch
@@ -12,125 +12,125 @@
 block discarded – undo
12 12
 class Hooks extends AbstractRepositories
13 13
 {
14 14
 
15
-    /**
16
-     * List hooks
17
-     *
18
-     * @link https://developer.github.com/v3/repos/hooks/#list-hooks
19
-     * @return array
20
-     */
21
-    public function listHooks(): array
22
-    {
23
-        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/hooks',
24
-            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo()));
25
-    }
15
+	/**
16
+	 * List hooks
17
+	 *
18
+	 * @link https://developer.github.com/v3/repos/hooks/#list-hooks
19
+	 * @return array
20
+	 */
21
+	public function listHooks(): array
22
+	{
23
+		return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/hooks',
24
+			$this->getRepositories()->getOwner(), $this->getRepositories()->getRepo()));
25
+	}
26 26
 
27
-    /**
28
-     * Get single hook
29
-     *
30
-     * @link https://developer.github.com/v3/repos/hooks/#get-single-hook
31
-     *
32
-     * @param int $id
33
-     *
34
-     * @return array
35
-     */
36
-    public function getSingleHook(int $id): array
37
-    {
38
-        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/hooks/:id',
39
-            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), $id));
40
-    }
27
+	/**
28
+	 * Get single hook
29
+	 *
30
+	 * @link https://developer.github.com/v3/repos/hooks/#get-single-hook
31
+	 *
32
+	 * @param int $id
33
+	 *
34
+	 * @return array
35
+	 */
36
+	public function getSingleHook(int $id): array
37
+	{
38
+		return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/hooks/:id',
39
+			$this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), $id));
40
+	}
41 41
 
42
-    /**
43
-     * Create a hook
44
-     *
45
-     * @link https://developer.github.com/v3/repos/hooks/#create-a-hook
46
-     *
47
-     * @param string $name
48
-     * @param string $config
49
-     * @param array  $events
50
-     * @param bool   $active
51
-     *
52
-     * @return array
53
-     */
54
-    public function createHook(string $name, string $config, array $events = ['push'], bool $active = true): array
55
-    {
56
-        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/hooks',
57
-            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo()), Request::METHOD_POST, [
58
-                'name'   => $name,
59
-                'config' => $config,
60
-                'events' => $events,
61
-                'active' => $active
62
-            ]);
63
-    }
42
+	/**
43
+	 * Create a hook
44
+	 *
45
+	 * @link https://developer.github.com/v3/repos/hooks/#create-a-hook
46
+	 *
47
+	 * @param string $name
48
+	 * @param string $config
49
+	 * @param array  $events
50
+	 * @param bool   $active
51
+	 *
52
+	 * @return array
53
+	 */
54
+	public function createHook(string $name, string $config, array $events = ['push'], bool $active = true): array
55
+	{
56
+		return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/hooks',
57
+			$this->getRepositories()->getOwner(), $this->getRepositories()->getRepo()), Request::METHOD_POST, [
58
+				'name'   => $name,
59
+				'config' => $config,
60
+				'events' => $events,
61
+				'active' => $active
62
+			]);
63
+	}
64 64
 
65
-    /**
66
-     * Edit a hook
67
-     *
68
-     * @link https://developer.github.com/v3/repos/hooks/#edit-a-hook
69
-     *
70
-     * @param int    $id
71
-     * @param string $config
72
-     * @param array  $events
73
-     * @param array  $addEvents
74
-     * @param array  $removeEvents
75
-     * @param bool   $active
76
-     *
77
-     * @return array
78
-     */
79
-    public function editHook(int $id, string $config, array $events = ['push'], array $addEvents = [],
80
-                             array $removeEvents = [], bool $active = true): array
81
-    {
82
-        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/hooks/:id',
83
-            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), $id), Request::METHOD_PATCH, [
84
-                'config'        => $config,
85
-                'events'        => $events,
86
-                'add_events'    => $addEvents,
87
-                'remove_events' => $removeEvents,
88
-                'active'        => $active
89
-            ]);
90
-    }
65
+	/**
66
+	 * Edit a hook
67
+	 *
68
+	 * @link https://developer.github.com/v3/repos/hooks/#edit-a-hook
69
+	 *
70
+	 * @param int    $id
71
+	 * @param string $config
72
+	 * @param array  $events
73
+	 * @param array  $addEvents
74
+	 * @param array  $removeEvents
75
+	 * @param bool   $active
76
+	 *
77
+	 * @return array
78
+	 */
79
+	public function editHook(int $id, string $config, array $events = ['push'], array $addEvents = [],
80
+							 array $removeEvents = [], bool $active = true): array
81
+	{
82
+		return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/hooks/:id',
83
+			$this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), $id), Request::METHOD_PATCH, [
84
+				'config'        => $config,
85
+				'events'        => $events,
86
+				'add_events'    => $addEvents,
87
+				'remove_events' => $removeEvents,
88
+				'active'        => $active
89
+			]);
90
+	}
91 91
 
92
-    /**
93
-     * Test a push hook
94
-     *
95
-     * @link https://developer.github.com/v3/repos/hooks/#test-a-push-hook
96
-     *
97
-     * @param int $id
98
-     *
99
-     * @return array
100
-     */
101
-    public function testPushHook(int $id): array
102
-    {
103
-        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/hooks/:id/tests',
104
-            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), $id), Request::METHOD_POST);
105
-    }
92
+	/**
93
+	 * Test a push hook
94
+	 *
95
+	 * @link https://developer.github.com/v3/repos/hooks/#test-a-push-hook
96
+	 *
97
+	 * @param int $id
98
+	 *
99
+	 * @return array
100
+	 */
101
+	public function testPushHook(int $id): array
102
+	{
103
+		return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/hooks/:id/tests',
104
+			$this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), $id), Request::METHOD_POST);
105
+	}
106 106
 
107
-    /**
108
-     * Ping a hook
109
-     *
110
-     * @link https://developer.github.com/v3/repos/hooks/#ping-a-hook
111
-     *
112
-     * @param int $id
113
-     *
114
-     * @return array
115
-     */
116
-    public function pingHook(int $id): array
117
-    {
118
-        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/hooks/:id/pings',
119
-            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), $id), Request::METHOD_POST);
120
-    }
107
+	/**
108
+	 * Ping a hook
109
+	 *
110
+	 * @link https://developer.github.com/v3/repos/hooks/#ping-a-hook
111
+	 *
112
+	 * @param int $id
113
+	 *
114
+	 * @return array
115
+	 */
116
+	public function pingHook(int $id): array
117
+	{
118
+		return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/hooks/:id/pings',
119
+			$this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), $id), Request::METHOD_POST);
120
+	}
121 121
 
122
-    /**
123
-     * Delete a hook
124
-     *
125
-     * @link https://developer.github.com/v3/repos/hooks/#delete-a-hook
126
-     *
127
-     * @param int $id
128
-     *
129
-     * @return array
130
-     */
131
-    public function deleteHook(int $id): array
132
-    {
133
-        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/hooks/:id',
134
-            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), $id), Request::METHOD_DELETE);
135
-    }
122
+	/**
123
+	 * Delete a hook
124
+	 *
125
+	 * @link https://developer.github.com/v3/repos/hooks/#delete-a-hook
126
+	 *
127
+	 * @param int $id
128
+	 *
129
+	 * @return array
130
+	 */
131
+	public function deleteHook(int $id): array
132
+	{
133
+		return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/hooks/:id',
134
+			$this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), $id), Request::METHOD_DELETE);
135
+	}
136 136
 }
137 137
\ No newline at end of file
Please login to merge, or discard this patch.
lib/GitHub/Receiver/Repositories/Releases.php 1 patch
Indentation   +231 added lines, -231 removed lines patch added patch discarded remove patch
@@ -14,235 +14,235 @@
 block discarded – undo
14 14
 class Releases extends AbstractRepositories
15 15
 {
16 16
 
17
-    /**
18
-     * List releases for a repository
19
-     *
20
-     * @link https://developer.github.com/v3/repos/releases/#list-releases-for-a-repository
21
-     * @return array
22
-     */
23
-    public function listReleases(): array
24
-    {
25
-        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/releases',
26
-            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo()));
27
-    }
28
-
29
-    /**
30
-     * Get a single release
31
-     *
32
-     * @link https://developer.github.com/v3/repos/releases/#get-a-single-release
33
-     *
34
-     * @param string $id
35
-     *
36
-     * @return array
37
-     */
38
-    public function getSingleRelease(string $id): array
39
-    {
40
-        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/releases/:id',
41
-            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), $id));
42
-    }
43
-
44
-    /**
45
-     * Get the latest release
46
-     *
47
-     * @link https://developer.github.com/v3/repos/releases/#get-the-latest-release
48
-     * @return array
49
-     * @throws \Exception
50
-     */
51
-    public function getLatestRelease(): array
52
-    {
53
-        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/releases/latest',
54
-            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo()));
55
-    }
56
-
57
-    /**
58
-     * Get a release by tag name
59
-     *
60
-     * @link https://developer.github.com/v3/repos/releases/#get-a-release-by-tag-name
61
-     *
62
-     * @param string $tag
63
-     *
64
-     * @return array
65
-     * @throws \Exception
66
-     */
67
-    public function getReleaseByTagName(string $tag): array
68
-    {
69
-        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/releases/tags/:tag',
70
-            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), $tag));
71
-    }
72
-
73
-    /**
74
-     * Create a release
75
-     *
76
-     * @link https://developer.github.com/v3/repos/releases/#create-a-release
77
-     *
78
-     * @param string $tagName
79
-     * @param string $targetCommitish
80
-     * @param string $name
81
-     * @param string $body
82
-     * @param bool   $draft
83
-     * @param bool   $preRelease
84
-     *
85
-     * @return array
86
-     */
87
-    public function createRelease(string $tagName, string $targetCommitish = AbstractApi::BRANCH_MASTER,
88
-                                  string $name = null, string $body = null, bool $draft = false,
89
-                                  bool $preRelease = false): array
90
-    {
91
-        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/releases',
92
-            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo()), Request::METHOD_POST, [
93
-                'tag_name'         => $tagName,
94
-                'target_commitish' => $targetCommitish,
95
-                'name'             => $name,
96
-                'body'             => $body,
97
-                'draft'            => $draft,
98
-                'prerelease'       => $preRelease
99
-            ]);
100
-    }
101
-
102
-    /**
103
-     * Edit a release
104
-     *
105
-     * @link https://developer.github.com/v3/repos/releases/#edit-a-release
106
-     *
107
-     * @param string $id
108
-     * @param string $tagName
109
-     * @param string $targetCommitish
110
-     * @param string $name
111
-     * @param string $body
112
-     * @param bool   $draft
113
-     * @param bool   $preRelease
114
-     *
115
-     * @return array
116
-     */
117
-    public function editRelease(string $id, string $tagName, string $targetCommitish = AbstractApi::BRANCH_MASTER,
118
-                                string $name, string $body, bool $draft = false, bool $preRelease = false): array
119
-    {
120
-        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/releases/:id',
121
-            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), $id), Request::METHOD_PATCH, [
122
-                'tag_name'         => $tagName,
123
-                'target_commitish' => $targetCommitish,
124
-                'name'             => $name,
125
-                'body'             => $body,
126
-                'draft'            => $draft,
127
-                'prerelease'       => $preRelease
128
-            ]);
129
-    }
130
-
131
-    /**
132
-     * Delete a release
133
-     *
134
-     * @link https://developer.github.com/v3/repos/releases/#delete-a-release
135
-     *
136
-     * @param string $id
137
-     *
138
-     * @return bool
139
-     */
140
-    public function deleteRelease(string $id): bool
141
-    {
142
-        $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/releases/:id',
143
-            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), $id), Request::METHOD_DELETE);
144
-
145
-        if ($this->getApi()->getHeaders()['Status'] == '204 No Content') {
146
-            return true;
147
-        }
148
-
149
-        return false;
150
-    }
151
-
152
-    /**
153
-     * List assets for a release
154
-     *
155
-     * @link https://developer.github.com/v3/repos/releases/#list-assets-for-a-release
156
-     *
157
-     * @param string $id
158
-     *
159
-     * @return array
160
-     */
161
-    public function getReleaseAssets(string $id): array
162
-    {
163
-        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/releases/:id/assets',
164
-            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), $id));
165
-    }
166
-
167
-    /**
168
-     * Upload a release asset
169
-     *
170
-     * @link https://developer.github.com/v3/repos/releases/#upload-a-release-asset
171
-     *
172
-     * @param string $id
173
-     * @param string $contentType
174
-     * @param string $name
175
-     *
176
-     * @return array
177
-     */
178
-    public function uploadReleaseAsset(string $id, string $contentType, string $name): array
179
-    {
180
-
181
-        return $this->getApi()->setApiUrl(AbstractApi::API_UPLOADS)->request($this->getApi()
182
-                                                                                  ->sprintf('/repos/:owner/:repo/releases/:id/assets?:arg',
183
-                                                                                      $this->getRepositories()
184
-                                                                                           ->getOwner(),
185
-                                                                                      $this->getRepositories()
186
-                                                                                           ->getRepo(), $id,
187
-                                                                                      http_build_query(['name' => $name])),
188
-            Request::METHOD_POST, [
189
-                'Content-Type' => $contentType
190
-            ]);
191
-    }
192
-
193
-    /**
194
-     * Get a single release asset
195
-     *
196
-     * @link https://developer.github.com/v3/repos/releases/#get-a-single-release-asset
197
-     *
198
-     * @param string $id
199
-     *
200
-     * @return array
201
-     */
202
-    public function getSingleReleaseAsset(string $id): array
203
-    {
204
-        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/releases/assets/:id',
205
-            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), $id));
206
-    }
207
-
208
-    /**
209
-     * Edit a release asset
210
-     *
211
-     * @link https://developer.github.com/v3/repos/releases/#edit-a-release-asset
212
-     *
213
-     * @param string $id
214
-     * @param string $name
215
-     * @param string $label
216
-     *
217
-     * @return array
218
-     */
219
-    public function editReleaseAsset(string $id, string $name, string $label = ''): array
220
-    {
221
-        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/releases/assets/:id',
222
-            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), $id), Request::METHOD_PATCH, [
223
-                'name'  => $name,
224
-                'label' => $label
225
-            ]);
226
-    }
227
-
228
-    /**
229
-     * Delete a release asset
230
-     *
231
-     * @link https://developer.github.com/v3/repos/releases/#delete-a-release-asset
232
-     *
233
-     * @param string $id
234
-     *
235
-     * @return bool
236
-     */
237
-    public function deleteReleaseAsset(string $id): bool
238
-    {
239
-        $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/releases/assets/:id',
240
-            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), $id), Request::METHOD_DELETE);
241
-
242
-        if ($this->getApi()->getHeaders()['Status'] == '204 No Content') {
243
-            return true;
244
-        }
245
-
246
-        return false;
247
-    }
17
+	/**
18
+	 * List releases for a repository
19
+	 *
20
+	 * @link https://developer.github.com/v3/repos/releases/#list-releases-for-a-repository
21
+	 * @return array
22
+	 */
23
+	public function listReleases(): array
24
+	{
25
+		return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/releases',
26
+			$this->getRepositories()->getOwner(), $this->getRepositories()->getRepo()));
27
+	}
28
+
29
+	/**
30
+	 * Get a single release
31
+	 *
32
+	 * @link https://developer.github.com/v3/repos/releases/#get-a-single-release
33
+	 *
34
+	 * @param string $id
35
+	 *
36
+	 * @return array
37
+	 */
38
+	public function getSingleRelease(string $id): array
39
+	{
40
+		return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/releases/:id',
41
+			$this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), $id));
42
+	}
43
+
44
+	/**
45
+	 * Get the latest release
46
+	 *
47
+	 * @link https://developer.github.com/v3/repos/releases/#get-the-latest-release
48
+	 * @return array
49
+	 * @throws \Exception
50
+	 */
51
+	public function getLatestRelease(): array
52
+	{
53
+		return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/releases/latest',
54
+			$this->getRepositories()->getOwner(), $this->getRepositories()->getRepo()));
55
+	}
56
+
57
+	/**
58
+	 * Get a release by tag name
59
+	 *
60
+	 * @link https://developer.github.com/v3/repos/releases/#get-a-release-by-tag-name
61
+	 *
62
+	 * @param string $tag
63
+	 *
64
+	 * @return array
65
+	 * @throws \Exception
66
+	 */
67
+	public function getReleaseByTagName(string $tag): array
68
+	{
69
+		return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/releases/tags/:tag',
70
+			$this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), $tag));
71
+	}
72
+
73
+	/**
74
+	 * Create a release
75
+	 *
76
+	 * @link https://developer.github.com/v3/repos/releases/#create-a-release
77
+	 *
78
+	 * @param string $tagName
79
+	 * @param string $targetCommitish
80
+	 * @param string $name
81
+	 * @param string $body
82
+	 * @param bool   $draft
83
+	 * @param bool   $preRelease
84
+	 *
85
+	 * @return array
86
+	 */
87
+	public function createRelease(string $tagName, string $targetCommitish = AbstractApi::BRANCH_MASTER,
88
+								  string $name = null, string $body = null, bool $draft = false,
89
+								  bool $preRelease = false): array
90
+	{
91
+		return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/releases',
92
+			$this->getRepositories()->getOwner(), $this->getRepositories()->getRepo()), Request::METHOD_POST, [
93
+				'tag_name'         => $tagName,
94
+				'target_commitish' => $targetCommitish,
95
+				'name'             => $name,
96
+				'body'             => $body,
97
+				'draft'            => $draft,
98
+				'prerelease'       => $preRelease
99
+			]);
100
+	}
101
+
102
+	/**
103
+	 * Edit a release
104
+	 *
105
+	 * @link https://developer.github.com/v3/repos/releases/#edit-a-release
106
+	 *
107
+	 * @param string $id
108
+	 * @param string $tagName
109
+	 * @param string $targetCommitish
110
+	 * @param string $name
111
+	 * @param string $body
112
+	 * @param bool   $draft
113
+	 * @param bool   $preRelease
114
+	 *
115
+	 * @return array
116
+	 */
117
+	public function editRelease(string $id, string $tagName, string $targetCommitish = AbstractApi::BRANCH_MASTER,
118
+								string $name, string $body, bool $draft = false, bool $preRelease = false): array
119
+	{
120
+		return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/releases/:id',
121
+			$this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), $id), Request::METHOD_PATCH, [
122
+				'tag_name'         => $tagName,
123
+				'target_commitish' => $targetCommitish,
124
+				'name'             => $name,
125
+				'body'             => $body,
126
+				'draft'            => $draft,
127
+				'prerelease'       => $preRelease
128
+			]);
129
+	}
130
+
131
+	/**
132
+	 * Delete a release
133
+	 *
134
+	 * @link https://developer.github.com/v3/repos/releases/#delete-a-release
135
+	 *
136
+	 * @param string $id
137
+	 *
138
+	 * @return bool
139
+	 */
140
+	public function deleteRelease(string $id): bool
141
+	{
142
+		$this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/releases/:id',
143
+			$this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), $id), Request::METHOD_DELETE);
144
+
145
+		if ($this->getApi()->getHeaders()['Status'] == '204 No Content') {
146
+			return true;
147
+		}
148
+
149
+		return false;
150
+	}
151
+
152
+	/**
153
+	 * List assets for a release
154
+	 *
155
+	 * @link https://developer.github.com/v3/repos/releases/#list-assets-for-a-release
156
+	 *
157
+	 * @param string $id
158
+	 *
159
+	 * @return array
160
+	 */
161
+	public function getReleaseAssets(string $id): array
162
+	{
163
+		return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/releases/:id/assets',
164
+			$this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), $id));
165
+	}
166
+
167
+	/**
168
+	 * Upload a release asset
169
+	 *
170
+	 * @link https://developer.github.com/v3/repos/releases/#upload-a-release-asset
171
+	 *
172
+	 * @param string $id
173
+	 * @param string $contentType
174
+	 * @param string $name
175
+	 *
176
+	 * @return array
177
+	 */
178
+	public function uploadReleaseAsset(string $id, string $contentType, string $name): array
179
+	{
180
+
181
+		return $this->getApi()->setApiUrl(AbstractApi::API_UPLOADS)->request($this->getApi()
182
+																				  ->sprintf('/repos/:owner/:repo/releases/:id/assets?:arg',
183
+																					  $this->getRepositories()
184
+																						   ->getOwner(),
185
+																					  $this->getRepositories()
186
+																						   ->getRepo(), $id,
187
+																					  http_build_query(['name' => $name])),
188
+			Request::METHOD_POST, [
189
+				'Content-Type' => $contentType
190
+			]);
191
+	}
192
+
193
+	/**
194
+	 * Get a single release asset
195
+	 *
196
+	 * @link https://developer.github.com/v3/repos/releases/#get-a-single-release-asset
197
+	 *
198
+	 * @param string $id
199
+	 *
200
+	 * @return array
201
+	 */
202
+	public function getSingleReleaseAsset(string $id): array
203
+	{
204
+		return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/releases/assets/:id',
205
+			$this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), $id));
206
+	}
207
+
208
+	/**
209
+	 * Edit a release asset
210
+	 *
211
+	 * @link https://developer.github.com/v3/repos/releases/#edit-a-release-asset
212
+	 *
213
+	 * @param string $id
214
+	 * @param string $name
215
+	 * @param string $label
216
+	 *
217
+	 * @return array
218
+	 */
219
+	public function editReleaseAsset(string $id, string $name, string $label = ''): array
220
+	{
221
+		return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/releases/assets/:id',
222
+			$this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), $id), Request::METHOD_PATCH, [
223
+				'name'  => $name,
224
+				'label' => $label
225
+			]);
226
+	}
227
+
228
+	/**
229
+	 * Delete a release asset
230
+	 *
231
+	 * @link https://developer.github.com/v3/repos/releases/#delete-a-release-asset
232
+	 *
233
+	 * @param string $id
234
+	 *
235
+	 * @return bool
236
+	 */
237
+	public function deleteReleaseAsset(string $id): bool
238
+	{
239
+		$this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/releases/assets/:id',
240
+			$this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), $id), Request::METHOD_DELETE);
241
+
242
+		if ($this->getApi()->getHeaders()['Status'] == '204 No Content') {
243
+			return true;
244
+		}
245
+
246
+		return false;
247
+	}
248 248
 }
249 249
\ No newline at end of file
Please login to merge, or discard this patch.
lib/GitHub/Receiver/Repositories/Merging.php 1 patch
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -12,24 +12,24 @@
 block discarded – undo
12 12
 class Merging extends AbstractRepositories
13 13
 {
14 14
 
15
-    /**
16
-     * Perform a merge
17
-     *
18
-     * @link https://developer.github.com/v3/repos/merging/#perform-a-merge
19
-     *
20
-     * @param string      $base
21
-     * @param string      $head
22
-     * @param string|null $commitMessage
23
-     *
24
-     * @return array
25
-     */
26
-    public function performMerge(string $base, string $head, string $commitMessage = null): array
27
-    {
28
-        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/merges',
29
-            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo()), Request::METHOD_POST, [
30
-                'base'           => $base,
31
-                'head'           => $head,
32
-                'commit_message' => $commitMessage
33
-            ]);
34
-    }
15
+	/**
16
+	 * Perform a merge
17
+	 *
18
+	 * @link https://developer.github.com/v3/repos/merging/#perform-a-merge
19
+	 *
20
+	 * @param string      $base
21
+	 * @param string      $head
22
+	 * @param string|null $commitMessage
23
+	 *
24
+	 * @return array
25
+	 */
26
+	public function performMerge(string $base, string $head, string $commitMessage = null): array
27
+	{
28
+		return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/merges',
29
+			$this->getRepositories()->getOwner(), $this->getRepositories()->getRepo()), Request::METHOD_POST, [
30
+				'base'           => $base,
31
+				'head'           => $head,
32
+				'commit_message' => $commitMessage
33
+			]);
34
+	}
35 35
 } 
36 36
\ No newline at end of file
Please login to merge, or discard this patch.
lib/GitHub/Receiver/Repositories/Pages.php 1 patch
Indentation   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -10,39 +10,39 @@
 block discarded – undo
10 10
 class Pages extends AbstractRepositories
11 11
 {
12 12
 
13
-    /**
14
-     * Get information about a Pages site
15
-     *
16
-     * @link https://developer.github.com/v3/repos/pages/#get-information-about-a-pages-site
17
-     * @return array
18
-     */
19
-    public function getInformation(): array
20
-    {
21
-        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/pages',
22
-            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo()));
23
-    }
13
+	/**
14
+	 * Get information about a Pages site
15
+	 *
16
+	 * @link https://developer.github.com/v3/repos/pages/#get-information-about-a-pages-site
17
+	 * @return array
18
+	 */
19
+	public function getInformation(): array
20
+	{
21
+		return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/pages',
22
+			$this->getRepositories()->getOwner(), $this->getRepositories()->getRepo()));
23
+	}
24 24
 
25
-    /**
26
-     * List Pages builds
27
-     *
28
-     * @link https://developer.github.com/v3/repos/pages/#list-pages-builds
29
-     * @return array
30
-     */
31
-    public function listPagesBuilds(): array
32
-    {
33
-        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/pages/builds',
34
-            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo()));
35
-    }
25
+	/**
26
+	 * List Pages builds
27
+	 *
28
+	 * @link https://developer.github.com/v3/repos/pages/#list-pages-builds
29
+	 * @return array
30
+	 */
31
+	public function listPagesBuilds(): array
32
+	{
33
+		return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/pages/builds',
34
+			$this->getRepositories()->getOwner(), $this->getRepositories()->getRepo()));
35
+	}
36 36
 
37
-    /**
38
-     * List latest Pages build
39
-     *
40
-     * @link https://developer.github.com/v3/repos/pages/#list-latest-pages-build
41
-     * @return array
42
-     */
43
-    public function listLatestPagesBuilds(): array
44
-    {
45
-        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/pages/builds/latest',
46
-            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo()));
47
-    }
37
+	/**
38
+	 * List latest Pages build
39
+	 *
40
+	 * @link https://developer.github.com/v3/repos/pages/#list-latest-pages-build
41
+	 * @return array
42
+	 */
43
+	public function listLatestPagesBuilds(): array
44
+	{
45
+		return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/pages/builds/latest',
46
+			$this->getRepositories()->getOwner(), $this->getRepositories()->getRepo()));
47
+	}
48 48
 }
49 49
\ No newline at end of file
Please login to merge, or discard this patch.
lib/GitHub/Receiver/Gists.php 1 patch
Indentation   +226 added lines, -226 removed lines patch added patch discarded remove patch
@@ -13,253 +13,253 @@
 block discarded – undo
13 13
 class Gists extends AbstractReceiver
14 14
 {
15 15
 
16
-    /** Available sub-Receiver */
17
-    const COMMENTS = 'Comments';
16
+	/** Available sub-Receiver */
17
+	const COMMENTS = 'Comments';
18 18
 
19
-    /**
20
-     * List gists
21
-     *
22
-     * @link https://developer.github.com/v3/gists/#list-gists
23
-     *
24
-     * @param string $username
25
-     * @param string $since
26
-     *
27
-     * @return array
28
-     */
29
-    public function listGists(string $username = null, string $since = '1970-01-01'): array
30
-    {
31
-        $url = '/gists';
32
-        if (null !== $username) {
33
-            $url = '/users/:username/gists';
34
-        }
19
+	/**
20
+	 * List gists
21
+	 *
22
+	 * @link https://developer.github.com/v3/gists/#list-gists
23
+	 *
24
+	 * @param string $username
25
+	 * @param string $since
26
+	 *
27
+	 * @return array
28
+	 */
29
+	public function listGists(string $username = null, string $since = '1970-01-01'): array
30
+	{
31
+		$url = '/gists';
32
+		if (null !== $username) {
33
+			$url = '/users/:username/gists';
34
+		}
35 35
 
36
-        return $this->getApi()->request($this->getApi()->sprintf(':url?:arg', $url, $username,
37
-            http_build_query(['since' => (new DateTime($since))->format(DateTime::ATOM)])));
38
-    }
36
+		return $this->getApi()->request($this->getApi()->sprintf(':url?:arg', $url, $username,
37
+			http_build_query(['since' => (new DateTime($since))->format(DateTime::ATOM)])));
38
+	}
39 39
 
40
-    /**
41
-     * List all public gists:
42
-     *
43
-     * @link https://developer.github.com/v3/gists/#list-gists
44
-     *
45
-     * @param string $since
46
-     *
47
-     * @return array
48
-     */
49
-    public function listPublicGists(string $since = '1970-01-01'): array
50
-    {
51
-        return $this->getApi()->request($this->getApi()->sprintf('/gists/public?:arg',
52
-            http_build_query(['since' => (new DateTime($since))->format(DateTime::ATOM)])));
53
-    }
40
+	/**
41
+	 * List all public gists:
42
+	 *
43
+	 * @link https://developer.github.com/v3/gists/#list-gists
44
+	 *
45
+	 * @param string $since
46
+	 *
47
+	 * @return array
48
+	 */
49
+	public function listPublicGists(string $since = '1970-01-01'): array
50
+	{
51
+		return $this->getApi()->request($this->getApi()->sprintf('/gists/public?:arg',
52
+			http_build_query(['since' => (new DateTime($since))->format(DateTime::ATOM)])));
53
+	}
54 54
 
55
-    /**
56
-     * List the authenticated user’s starred gists
57
-     *
58
-     * @link https://developer.github.com/v3/gists/#list-gists
59
-     *
60
-     * @param string $since
61
-     *
62
-     * @return array
63
-     */
64
-    public function listUsersStarredGists(string $since = '1970-01-01'): array
65
-    {
66
-        return $this->getApi()->request($this->getApi()->sprintf('/gists/starred?:arg',
67
-            http_build_query(['since' => (new DateTime($since))->format(DateTime::ATOM)])));
68
-    }
55
+	/**
56
+	 * List the authenticated user’s starred gists
57
+	 *
58
+	 * @link https://developer.github.com/v3/gists/#list-gists
59
+	 *
60
+	 * @param string $since
61
+	 *
62
+	 * @return array
63
+	 */
64
+	public function listUsersStarredGists(string $since = '1970-01-01'): array
65
+	{
66
+		return $this->getApi()->request($this->getApi()->sprintf('/gists/starred?:arg',
67
+			http_build_query(['since' => (new DateTime($since))->format(DateTime::ATOM)])));
68
+	}
69 69
 
70
-    /**
71
-     * Get a single gist
72
-     *
73
-     * @link https://developer.github.com/v3/gists/#get-a-single-gist
74
-     *
75
-     * @param int $id
76
-     *
77
-     * @return array
78
-     */
79
-    public function getGist(int $id): array
80
-    {
81
-        return $this->getApi()->request($this->getApi()->sprintf('/gists/:id', $id));
82
-    }
70
+	/**
71
+	 * Get a single gist
72
+	 *
73
+	 * @link https://developer.github.com/v3/gists/#get-a-single-gist
74
+	 *
75
+	 * @param int $id
76
+	 *
77
+	 * @return array
78
+	 */
79
+	public function getGist(int $id): array
80
+	{
81
+		return $this->getApi()->request($this->getApi()->sprintf('/gists/:id', $id));
82
+	}
83 83
 
84
-    /**
85
-     * Get a specific revision of a gist
86
-     *
87
-     * @link https://developer.github.com/v3/gists/#get-a-specific-revision-of-a-gist
88
-     *
89
-     * @param string $id
90
-     * @param string $sha
91
-     *
92
-     * @return array
93
-     * @throws \Exception
94
-     */
95
-    public function getGistRevision(string $id, string $sha): array
96
-    {
97
-        return $this->getApi()->request($this->getApi()->sprintf('/gists/:id/:sha', $id, $sha));
98
-    }
84
+	/**
85
+	 * Get a specific revision of a gist
86
+	 *
87
+	 * @link https://developer.github.com/v3/gists/#get-a-specific-revision-of-a-gist
88
+	 *
89
+	 * @param string $id
90
+	 * @param string $sha
91
+	 *
92
+	 * @return array
93
+	 * @throws \Exception
94
+	 */
95
+	public function getGistRevision(string $id, string $sha): array
96
+	{
97
+		return $this->getApi()->request($this->getApi()->sprintf('/gists/:id/:sha', $id, $sha));
98
+	}
99 99
 
100
-    /**
101
-     * Create a gist
102
-     *
103
-     * @link https://developer.github.com/v3/gists/#create-a-gist
104
-     *
105
-     * @param string $files
106
-     * @param string $description
107
-     * @param bool   $public
108
-     *
109
-     * @return array
110
-     */
111
-    public function createGist(string $files, string $description = null, bool $public = false): array
112
-    {
113
-        return $this->getApi()->request($this->getApi()->sprintf('/gists'), Request::METHOD_POST, [
114
-                'file'        => $files,
115
-                'description' => $description,
116
-                'public'      => $public
117
-            ]);
118
-    }
100
+	/**
101
+	 * Create a gist
102
+	 *
103
+	 * @link https://developer.github.com/v3/gists/#create-a-gist
104
+	 *
105
+	 * @param string $files
106
+	 * @param string $description
107
+	 * @param bool   $public
108
+	 *
109
+	 * @return array
110
+	 */
111
+	public function createGist(string $files, string $description = null, bool $public = false): array
112
+	{
113
+		return $this->getApi()->request($this->getApi()->sprintf('/gists'), Request::METHOD_POST, [
114
+				'file'        => $files,
115
+				'description' => $description,
116
+				'public'      => $public
117
+			]);
118
+	}
119 119
 
120
-    /**
121
-     * Edit a gist
122
-     *
123
-     * @link https://developer.github.com/v3/gists/#edit-a-gist
124
-     *
125
-     * @param int    $id
126
-     * @param string $description
127
-     * @param string $files
128
-     * @param string $content
129
-     * @param string $filename
130
-     *
131
-     * @return array
132
-     */
133
-    public function editGist(int $id, string $description = '', string $files = '{}', string $content = '',
134
-                             string $filename = ''): array
135
-    {
136
-        return $this->getApi()->request($this->getApi()->sprintf('/gists/:id', $id), Request::METHOD_PATCH, [
137
-                'description' => $description,
138
-                'files'       => $files,
139
-                'content'     => $content,
140
-                'filename'    => $filename
141
-            ]);
142
-    }
120
+	/**
121
+	 * Edit a gist
122
+	 *
123
+	 * @link https://developer.github.com/v3/gists/#edit-a-gist
124
+	 *
125
+	 * @param int    $id
126
+	 * @param string $description
127
+	 * @param string $files
128
+	 * @param string $content
129
+	 * @param string $filename
130
+	 *
131
+	 * @return array
132
+	 */
133
+	public function editGist(int $id, string $description = '', string $files = '{}', string $content = '',
134
+							 string $filename = ''): array
135
+	{
136
+		return $this->getApi()->request($this->getApi()->sprintf('/gists/:id', $id), Request::METHOD_PATCH, [
137
+				'description' => $description,
138
+				'files'       => $files,
139
+				'content'     => $content,
140
+				'filename'    => $filename
141
+			]);
142
+	}
143 143
 
144
-    /**
145
-     * List gist commits
146
-     *
147
-     * @link https://developer.github.com/v3/gists/#list-gist-commits
148
-     *
149
-     * @param int $id
150
-     *
151
-     * @return array
152
-     */
153
-    public function listGistsCommits(int $id): array
154
-    {
155
-        return $this->getApi()->request($this->getApi()->sprintf('/gists/:id/commits', $id));
156
-    }
144
+	/**
145
+	 * List gist commits
146
+	 *
147
+	 * @link https://developer.github.com/v3/gists/#list-gist-commits
148
+	 *
149
+	 * @param int $id
150
+	 *
151
+	 * @return array
152
+	 */
153
+	public function listGistsCommits(int $id): array
154
+	{
155
+		return $this->getApi()->request($this->getApi()->sprintf('/gists/:id/commits', $id));
156
+	}
157 157
 
158
-    /**
159
-     * Star a gist
160
-     *
161
-     * @link https://developer.github.com/v3/gists/#star-a-gist
162
-     *
163
-     * @param int $id
164
-     *
165
-     * @return bool
166
-     */
167
-    public function starGist(int $id): bool
168
-    {
169
-        $this->getApi()->request($this->getApi()->sprintf('/gists/:id/star', $id), Request::METHOD_PUT);
158
+	/**
159
+	 * Star a gist
160
+	 *
161
+	 * @link https://developer.github.com/v3/gists/#star-a-gist
162
+	 *
163
+	 * @param int $id
164
+	 *
165
+	 * @return bool
166
+	 */
167
+	public function starGist(int $id): bool
168
+	{
169
+		$this->getApi()->request($this->getApi()->sprintf('/gists/:id/star', $id), Request::METHOD_PUT);
170 170
 
171
-        if ($this->getApi()->getHeaders()['Status'] == '204 No Content') {
172
-            return true;
173
-        }
171
+		if ($this->getApi()->getHeaders()['Status'] == '204 No Content') {
172
+			return true;
173
+		}
174 174
 
175
-        return false;
176
-    }
175
+		return false;
176
+	}
177 177
 
178
-    /**
179
-     * Unstar a gist
180
-     *
181
-     * @link https://developer.github.com/v3/gists/#unstar-a-gist
182
-     *
183
-     * @param int $id
184
-     *
185
-     * @return bool
186
-     */
187
-    public function unStarGist(int $id): bool
188
-    {
189
-        $this->getApi()->request($this->getApi()->sprintf('/gists/:id/star', $id), Request::METHOD_DELETE);
178
+	/**
179
+	 * Unstar a gist
180
+	 *
181
+	 * @link https://developer.github.com/v3/gists/#unstar-a-gist
182
+	 *
183
+	 * @param int $id
184
+	 *
185
+	 * @return bool
186
+	 */
187
+	public function unStarGist(int $id): bool
188
+	{
189
+		$this->getApi()->request($this->getApi()->sprintf('/gists/:id/star', $id), Request::METHOD_DELETE);
190 190
 
191
-        if ($this->getApi()->getHeaders()['Status'] == '204 No Content') {
192
-            return true;
193
-        }
191
+		if ($this->getApi()->getHeaders()['Status'] == '204 No Content') {
192
+			return true;
193
+		}
194 194
 
195
-        return false;
196
-    }
195
+		return false;
196
+	}
197 197
 
198
-    /**
199
-     * Check if a gist is starred
200
-     *
201
-     * @link https://developer.github.com/v3/gists/#check-if-a-gist-is-starred
202
-     *
203
-     * @param int $id
204
-     *
205
-     * @return bool
206
-     */
207
-    public function checkGistIsStarred(int $id): bool
208
-    {
209
-        $this->getApi()->request($this->getApi()->sprintf('/gists/:id/star', $id));
198
+	/**
199
+	 * Check if a gist is starred
200
+	 *
201
+	 * @link https://developer.github.com/v3/gists/#check-if-a-gist-is-starred
202
+	 *
203
+	 * @param int $id
204
+	 *
205
+	 * @return bool
206
+	 */
207
+	public function checkGistIsStarred(int $id): bool
208
+	{
209
+		$this->getApi()->request($this->getApi()->sprintf('/gists/:id/star', $id));
210 210
 
211
-        if ($this->getApi()->getHeaders()['Status'] == '204 No Content') {
212
-            return true;
213
-        }
211
+		if ($this->getApi()->getHeaders()['Status'] == '204 No Content') {
212
+			return true;
213
+		}
214 214
 
215
-        return false;
216
-    }
215
+		return false;
216
+	}
217 217
 
218
-    /**
219
-     * Fork a gist
220
-     *
221
-     * @link https://developer.github.com/v3/gists/#fork-a-gist
222
-     *
223
-     * @param int $id
224
-     *
225
-     * @return array
226
-     */
227
-    public function forkGist(int $id): array
228
-    {
229
-        return $this->getApi()->request($this->getApi()->sprintf('/gists/:id/forks', $id), Request::METHOD_POST);
230
-    }
218
+	/**
219
+	 * Fork a gist
220
+	 *
221
+	 * @link https://developer.github.com/v3/gists/#fork-a-gist
222
+	 *
223
+	 * @param int $id
224
+	 *
225
+	 * @return array
226
+	 */
227
+	public function forkGist(int $id): array
228
+	{
229
+		return $this->getApi()->request($this->getApi()->sprintf('/gists/:id/forks', $id), Request::METHOD_POST);
230
+	}
231 231
 
232
-    /**
233
-     * List gist forks
234
-     *
235
-     * @link https://developer.github.com/v3/gists/#list-gist-forks
236
-     *
237
-     * @param int $id
238
-     *
239
-     * @return array
240
-     */
241
-    public function listGistForks(int $id): array
242
-    {
243
-        return $this->getApi()->request($this->getApi()->sprintf('/gists/:id/forks', $id));
244
-    }
232
+	/**
233
+	 * List gist forks
234
+	 *
235
+	 * @link https://developer.github.com/v3/gists/#list-gist-forks
236
+	 *
237
+	 * @param int $id
238
+	 *
239
+	 * @return array
240
+	 */
241
+	public function listGistForks(int $id): array
242
+	{
243
+		return $this->getApi()->request($this->getApi()->sprintf('/gists/:id/forks', $id));
244
+	}
245 245
 
246
-    /**
247
-     * Delete a gist
248
-     *
249
-     * @link https://developer.github.com/v3/gists/#delete-a-gist
250
-     *
251
-     * @param int $id
252
-     *
253
-     * @return bool
254
-     */
255
-    public function deleteGist(int $id): bool
256
-    {
257
-        $this->getApi()->request($this->getApi()->sprintf('/gists/:id', $id), Request::METHOD_DELETE);
246
+	/**
247
+	 * Delete a gist
248
+	 *
249
+	 * @link https://developer.github.com/v3/gists/#delete-a-gist
250
+	 *
251
+	 * @param int $id
252
+	 *
253
+	 * @return bool
254
+	 */
255
+	public function deleteGist(int $id): bool
256
+	{
257
+		$this->getApi()->request($this->getApi()->sprintf('/gists/:id', $id), Request::METHOD_DELETE);
258 258
 
259
-        if ($this->getApi()->getHeaders()['Status'] == '204 No Content') {
260
-            return true;
261
-        }
259
+		if ($this->getApi()->getHeaders()['Status'] == '204 No Content') {
260
+			return true;
261
+		}
262 262
 
263
-        return false;
264
-    }
263
+		return false;
264
+	}
265 265
 } 
266 266
\ No newline at end of file
Please login to merge, or discard this patch.