From dfe26c3caa2db18a708d9352e8ad44073a923c3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikola=20Mijajlovi=C4=87?= Date: Wed, 15 Jun 2016 21:02:12 +0200 Subject: [PATCH 1/7] Attachment upload limit --- src/Jira/Api.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Jira/Api.php b/src/Jira/Api.php index cc7dd40..9082c5b 100644 --- a/src/Jira/Api.php +++ b/src/Jira/Api.php @@ -197,6 +197,16 @@ public function editIssue($issue_key, array $params) return $this->api(self::REQUEST_PUT, sprintf('/rest/api/2/issue/%s', $issue_key), $params); } + /** + * Gets attachment upload limit. + * + * @return array + */ + public function getAttachmentUploadLimit() + { + return $this->api(self::REQUEST_GET, '/rest/api/2/attachment/meta', array()); + } + /** * Gets attachment. * From 70137dc6687f9dd660f5c809c759811b9470a44e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikola=20Mijajlovi=C4=87?= Date: Wed, 15 Jun 2016 21:24:38 +0200 Subject: [PATCH 2/7] Method name change --- src/Jira/Api.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Jira/Api.php b/src/Jira/Api.php index 9082c5b..7fdb3f3 100644 --- a/src/Jira/Api.php +++ b/src/Jira/Api.php @@ -202,7 +202,6 @@ public function editIssue($issue_key, array $params) * * @return array */ - public function getAttachmentUploadLimit() { return $this->api(self::REQUEST_GET, '/rest/api/2/attachment/meta', array()); } From 8fbf786e4b4894e40530aef38aecec7636b4a238 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikola=20Mijajlovi=C4=87?= Date: Wed, 15 Jun 2016 21:26:33 +0200 Subject: [PATCH 3/7] getAttachmentsLimit changed to getAttachmentsMeta --- src/Jira/Api.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Jira/Api.php b/src/Jira/Api.php index 7fdb3f3..b2fbddf 100644 --- a/src/Jira/Api.php +++ b/src/Jira/Api.php @@ -202,6 +202,7 @@ public function editIssue($issue_key, array $params) * * @return array */ + public function getAttachmentsMeta() { return $this->api(self::REQUEST_GET, '/rest/api/2/attachment/meta', array()); } From eb4dac52f9f6bd879c315c6fe58396a6892100ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikola=20Mijajlovi=C4=87?= Date: Wed, 15 Jun 2016 21:41:19 +0200 Subject: [PATCH 4/7] getAttachmentsMeta name change and documentation update --- src/Jira/Api.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Jira/Api.php b/src/Jira/Api.php index b2fbddf..b359a25 100644 --- a/src/Jira/Api.php +++ b/src/Jira/Api.php @@ -198,11 +198,12 @@ public function editIssue($issue_key, array $params) } /** - * Gets attachment upload limit. + * Gets attachments meta information. * * @return array + * @since 2.0.0 */ - public function getAttachmentsMeta() + public function getAttachmentsMetaInformation() { return $this->api(self::REQUEST_GET, '/rest/api/2/attachment/meta', array()); } From 231f29b160dcc706cab5beceead35d573b84ab7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikola=20Mijajlovi=C4=87?= Date: Wed, 15 Jun 2016 21:48:51 +0200 Subject: [PATCH 5/7] Remove empty array as third parameter due it is default value --- src/Jira/Api.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Jira/Api.php b/src/Jira/Api.php index b359a25..efbc39e 100644 --- a/src/Jira/Api.php +++ b/src/Jira/Api.php @@ -205,7 +205,7 @@ public function editIssue($issue_key, array $params) */ public function getAttachmentsMetaInformation() { - return $this->api(self::REQUEST_GET, '/rest/api/2/attachment/meta', array()); + return $this->api(self::REQUEST_GET, '/rest/api/2/attachment/meta'); } /** From f19ca8a29b0f826d979f1a0aa4979fba0902d482 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikola=20Mijajlovi=C4=87?= Date: Thu, 16 Jun 2016 22:46:42 +0200 Subject: [PATCH 6/7] additional functionality --- src/Jira/Api.php | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/src/Jira/Api.php b/src/Jira/Api.php index efbc39e..3db690a 100644 --- a/src/Jira/Api.php +++ b/src/Jira/Api.php @@ -846,4 +846,42 @@ public function closeIssue($issue_key) return $result; } + /** + * Returns project components. + * + * @param string $project_key Project key. + * + * @return array|false + * @since 2.0.0 + */ + public function getProjectComponents($project_key) + { + return $this->api(self::REQUEST_GET, sprintf('/rest/api/2/project/%s/components', $project_key), array(), true); + } + + /** + * Get all issue types with valid status values for a project. + * + * @param string $project_key Project key. + * + * @return array + * @since 2.0.0 + */ + public function getAllIssueTypes($project_key) + { + return $this->api(self::REQUEST_GET, "/rest/api/2/project/{$project_key}/statuses", array(), true); + } + + /** + * Returns a list of all resolutions. + * + * @param string $project_key Project key. + * + * @return array|false + * @since 2.0.0 + */ + public function getResolutions() + { + return $this->api(self::REQUEST_GET, "/rest/api/2/resolution", array(), true); + } } From e698dd6fe767919a5ac44e4db9408e43c090ac61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikola=20Mijajlovi=C4=87?= Date: Thu, 16 Jun 2016 23:02:23 +0200 Subject: [PATCH 7/7] code formating --- src/Jira/Api.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/Jira/Api.php b/src/Jira/Api.php index 3db690a..92d8804 100644 --- a/src/Jira/Api.php +++ b/src/Jira/Api.php @@ -846,7 +846,7 @@ public function closeIssue($issue_key) return $result; } - /** + /** * Returns project components. * * @param string $project_key Project key. @@ -859,7 +859,7 @@ public function getProjectComponents($project_key) return $this->api(self::REQUEST_GET, sprintf('/rest/api/2/project/%s/components', $project_key), array(), true); } - /** + /** * Get all issue types with valid status values for a project. * * @param string $project_key Project key. @@ -868,20 +868,20 @@ public function getProjectComponents($project_key) * @since 2.0.0 */ public function getAllIssueTypes($project_key) - { - return $this->api(self::REQUEST_GET, "/rest/api/2/project/{$project_key}/statuses", array(), true); - } + { + return $this->api(self::REQUEST_GET, "/rest/api/2/project/{$project_key}/statuses", array(), true); + } - /** - * Returns a list of all resolutions. + /** + * Returns a list of all resolutions. * * @param string $project_key Project key. * * @return array|false * @since 2.0.0 */ - public function getResolutions() - { - return $this->api(self::REQUEST_GET, "/rest/api/2/resolution", array(), true); - } + public function getResolutions() + { + return $this->api(self::REQUEST_GET, "/rest/api/2/resolution", array(), true); + } }