Skip to content

Commit c71f1fc

Browse files
committed
applied style ci
1 parent fc5401b commit c71f1fc

35 files changed

+218
-197
lines changed

src/ClassSerialize.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ trait ClassSerialize
88
* class property to Array.
99
*
1010
* @param array $ignoreProperties this properties to be (ex|in)cluded from array whether second param is true or false.
11-
* @param boolean $excludeMode
11+
* @param bool $excludeMode
1212
*
1313
* @return array
1414
*/
@@ -36,7 +36,7 @@ public function toArray($ignoreProperties = [], $excludeMode = true)
3636
* class property to String.
3737
*
3838
* @param array $ignoreProperties this properties to be excluded from String.
39-
* @param boolean $excludeMode
39+
* @param bool $excludeMode
4040
*
4141
* @return string
4242
*/

src/Dumper.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
namespace JiraRestApi;
44

5+
use Symfony\Component\VarDumper\Cloner\VarCloner;
56
use Symfony\Component\VarDumper\Dumper\CliDumper;
67
use Symfony\Component\VarDumper\Dumper\HtmlDumper;
7-
use Symfony\Component\VarDumper\Cloner\VarCloner;
88

99
class Dumper
1010
{
@@ -22,6 +22,7 @@ public static function dump($value)
2222
var_dump($value);
2323
}
2424
}
25+
2526
public static function dd($x)
2627
{
2728
array_map(function ($x) {

src/Field/Field.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?php
22

33
namespace JiraRestApi\Field;
4+
45
use JiraRestApi\ClassSerialize;
56

67
/**

src/Field/FieldService.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function getCustomFieldOption($id)
4444
{
4545
$ret = $this->exec('/customFieldOption', null);
4646

47-
$this->log->addDebug("Create Field=\n" . $ret);
47+
$this->log->addDebug("Create Field=\n".$ret);
4848

4949
return $ret;
5050
}
@@ -60,7 +60,7 @@ public function create(Field $field)
6060
{
6161
$data = json_encode($field);
6262

63-
$this->log->addInfo("Create Field=\n" . $data);
63+
$this->log->addInfo("Create Field=\n".$data);
6464

6565
$ret = $this->exec($this->uri, $data, 'POST');
6666

src/Group/Group.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
11
<?php
22

33
namespace JiraRestApi\Group;
4+
45
use JiraRestApi\ClassSerialize;
56

67
class GroupUser
78
{
89
/**
9-
* @var integer
10+
* @var int
1011
*/
1112
public $size;
1213

13-
/** @var array */
14+
/** @var array */
1415
public $items;
1516

16-
/** @var integer */
17+
/** @var int */
1718
public $max_results;
1819

19-
/** @var integer */
20+
/** @var int */
2021
public $start_index;
2122

22-
/** @var integer */
23+
/** @var int */
2324
public $end_index;
2425
}
2526

2627
/**
27-
* Class Group
28+
* Class Group.
2829
*
29-
* @package JiraRestApi\Group
3030
*
3131
* @see https://docs.atlassian.com/jira/REST/server/#api/2/group
3232
*/
@@ -61,10 +61,10 @@ public function jsonSerialize()
6161
return array_filter(get_object_vars($this));
6262
}
6363

64-
public function setName($name) {
64+
public function setName($name)
65+
{
6566
$this->name = $name;
6667

6768
return $this;
6869
}
69-
7070
}

src/Group/GroupSearchResult.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<?php
22

33
namespace JiraRestApi\Group;
4+
45
use JiraRestApi\ClassSerialize;
56

67
/**
7-
* Class GroupSearchResult
8+
* Class GroupSearchResult.
89
*
9-
* @package JiraRestApi\Group
1010
*
1111
* @see https://docs.atlassian.com/jira/REST/server/#api/2/group
1212
*/
@@ -22,21 +22,21 @@ class GroupSearchResult implements \JsonSerializable
2222
public $self;
2323

2424
/**
25-
* @var integer
25+
* @var int
2626
*/
2727
public $maxResults;
2828

2929
/**
30-
* @var integer
30+
* @var int
3131
*/
3232
public $startAt;
3333

3434
/**
35-
* @var integer
35+
* @var int
3636
*/
3737
public $total;
3838

39-
/** @var \JiraRestApi\User\User[] */
39+
/** @var \JiraRestApi\User\User[] */
4040
public $values;
4141

4242
public function jsonSerialize()

src/Group/GroupService.php

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
/**
66
* Class to perform all groups related queries.
7-
* @package JiraRestApi\Group
87
*/
98
class GroupService extends \JiraRestApi\JiraClient
109
{
@@ -14,7 +13,7 @@ class GroupService extends \JiraRestApi\JiraClient
1413
* Function to get group.
1514
*
1615
* @param array $paramArray Possible values for $paramArray 'username', 'key'.
17-
* "Either the 'username' or the 'key' query parameters need to be provided".
16+
* "Either the 'username' or the 'key' query parameters need to be provided".
1817
*
1918
* @return Group class
2019
*/
@@ -32,18 +31,20 @@ public function get($paramArray)
3231
}
3332

3433
/**
35-
* Get users from group
34+
* Get users from group.
3635
*
3736
* @param $paramArray groupname, includeInactiveUsers, startAt, maxResults
38-
* @return GroupSearchResult
37+
*
3938
* @throws \JiraRestApi\JiraException
4039
* @throws \JsonMapper_Exception
40+
*
41+
* @return GroupSearchResult
4142
*/
4243
public function getMembers($paramArray)
4344
{
44-
$queryParam = '?' . http_build_query($paramArray);
45+
$queryParam = '?'.http_build_query($paramArray);
4546

46-
$ret = $this->exec($this->uri . '/member'.$queryParam, null);
47+
$ret = $this->exec($this->uri.'/member'.$queryParam, null);
4748

4849
$this->log->addInfo("Result=\n".$ret);
4950

@@ -55,12 +56,14 @@ public function getMembers($paramArray)
5556
}
5657

5758
/**
58-
* Creates a group by given group parameter
59+
* Creates a group by given group parameter.
5960
*
6061
* @param $group \JiraRestApi\Group\Group
61-
* @return array
62+
*
6263
* @throws \JiraRestApi\JiraException
6364
* @throws \JsonMapper_Exception
65+
*
66+
* @return array
6467
*/
6568
public function createGroup($group)
6669
{
@@ -84,15 +87,17 @@ public function createGroup($group)
8487
* Adds given user to a group.
8588
*
8689
* @param $group
87-
* @return Returns the current state of the group.
90+
*
8891
* @throws \JiraRestApi\JiraException
8992
* @throws \JsonMapper_Exception
93+
*
94+
* @return Returns the current state of the group.
9095
*/
9196
public function addUserToGroup($groupName, $userName)
9297
{
93-
$data = json_encode(['name' => $userName,]);
98+
$data = json_encode(['name' => $userName]);
9499

95-
$ret = $this->exec($this->uri . '/user?groupname=' . urlencode($groupName), $data);
100+
$ret = $this->exec($this->uri.'/user?groupname='.urlencode($groupName), $data);
96101

97102
$this->log->addInfo("Result=\n".$ret);
98103

@@ -108,15 +113,17 @@ public function addUserToGroup($groupName, $userName)
108113
*
109114
* @param $groupName
110115
* @param $userName
111-
* @return null Returns no content
116+
*
112117
* @throws \JiraRestApi\JiraException
113118
* @throws \JsonMapper_Exception
119+
*
120+
* @return null Returns no content
114121
*/
115122
public function removeUserFromGroup($groupName, $userName)
116123
{
117124
$param = http_build_query(['groupname' => $groupName, 'username' => $userName]);
118125

119-
$ret = $this->exec($this->uri . '/user?' . $param, [], 'DELETE');
126+
$ret = $this->exec($this->uri.'/user?'.$param, [], 'DELETE');
120127

121128
$this->log->addInfo("Result=\n".$ret);
122129

src/Issue/Comment.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ public function setType($type)
1111
{
1212
$this->type = $type;
1313
}
14+
1415
public function setValue($value)
1516
{
1617
$this->value = $value;
@@ -20,6 +21,7 @@ public function getType()
2021
{
2122
return $this->type;
2223
}
24+
2325
public function getValue()
2426
{
2527
return $this->value;
@@ -68,7 +70,8 @@ public function setBody($body)
6870

6971
/**
7072
* @param Visibility $type
71-
* @param null $value
73+
* @param null $value
74+
*
7275
* @return $this
7376
*/
7477
public function setVisibility($type, $value = null)

src/Issue/Component.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
<?php namespace JiraRestApi\Issue;
1+
<?php
22

3+
namespace JiraRestApi\Issue;
34

45
class Component implements \JsonSerializable
56
{
@@ -13,6 +14,6 @@ public function __construct($name = null)
1314

1415
public function jsonSerialize()
1516
{
16-
return array_filter(get_object_vars($this));
17+
return array_filter(get_object_vars($this));
1718
}
18-
}
19+
}

src/Issue/IssueField.php

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public function __construct($updateIssue = false)
1515

1616
$this->assignee = new \JiraRestApi\Issue\Reporter();
1717
$this->priority = new \JiraRestApi\Issue\Priority();
18-
$this->versions = array();
18+
$this->versions = [];
1919

2020
$this->issuetype = new \JiraRestApi\Issue\IssueType();
2121
}
@@ -66,6 +66,7 @@ public function setProjectKey($key)
6666

6767
return $this;
6868
}
69+
6970
public function setProjectId($id)
7071
{
7172
$this->project->id = $id;
@@ -158,13 +159,13 @@ public function setDescription($description)
158159
public function addVersion($name)
159160
{
160161
if (is_null($this->versions)) {
161-
$this->versions = array();
162+
$this->versions = [];
162163
}
163164

164-
if (is_string($name)){
165+
if (is_string($name)) {
165166
array_push($this->versions, new Version($name));
166-
} else if (is_array($name)) {
167-
foreach($name as $v) {
167+
} elseif (is_array($name)) {
168+
foreach ($name as $v) {
168169
array_push($this->versions, new Version($v));
169170
}
170171
}
@@ -182,7 +183,7 @@ public function addVersion($name)
182183
public function addLabel($label)
183184
{
184185
if (is_null($this->labels)) {
185-
$this->labels = array();
186+
$this->labels = [];
186187
}
187188

188189
array_push($this->labels, $label);
@@ -246,13 +247,13 @@ public function setParent(Issue $parent)
246247
public function addComponents($component)
247248
{
248249
if (is_null($this->components)) {
249-
$this->components = array();
250+
$this->components = [];
250251
}
251252

252-
if (is_string($component)){
253+
if (is_string($component)) {
253254
array_push($this->components, new Component($component));
254-
} else if (is_array($component)) {
255-
foreach($component as $c) {
255+
} elseif (is_array($component)) {
256+
foreach ($component as $c) {
256257
array_push($this->components, new Component($c));
257258
}
258259
}
@@ -302,7 +303,7 @@ public function addComponents($component)
302303
/** @var string|null */
303304
public $environment;
304305

305-
/** @var \JiraRestApi\Issue\Component[] */
306+
/** @var \JiraRestApi\Issue\Component[] */
306307
public $components;
307308

308309
/** @var Comments */
@@ -335,16 +336,16 @@ public function addComponents($component)
335336
/** @var \JiraRestApi\Issue\Attachment[] */
336337
public $attachment;
337338

338-
/** @var string|null */
339+
/** @var string|null */
339340
public $aggregatetimespent;
340341

341-
/** @var string|null */
342+
/** @var string|null */
342343
public $timeestimate;
343344

344-
/** @var string|null */
345+
/** @var string|null */
345346
public $aggregatetimeoriginalestimate;
346347

347-
/** @var string|null */
348+
/** @var string|null */
348349
public $resolutiondate;
349350

350351
/** @var \DateTime|null */

0 commit comments

Comments
 (0)