Skip to content

Commit b333140

Browse files
committed
fixed coding standards
1 parent b381816 commit b333140

File tree

15 files changed

+147
-143
lines changed

15 files changed

+147
-143
lines changed

src/Field/Field.php

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@
33
namespace JiraRestApi\Field;
44

55
/**
6-
* Custom filed schema
6+
* Custom filed schema.
77
*
88
* Class Schema
9-
* @package JiraRestApi\Field
109
*/
1110
class Schema
1211
{
@@ -20,7 +19,6 @@ class Schema
2019
public $type;
2120

2221
/** i don't know what this means.
23-
*
2422
* @var string
2523
*/
2624
public $items;
@@ -41,38 +39,38 @@ class Schema
4139
}
4240

4341
/**
44-
* Class Field
42+
* Class Field.
4543
*
4644
* Jira Field Object mapper
47-
*
48-
* @package JiraRestApi\Field
4945
*/
5046
class Field implements \JsonSerializable
5147
{
5248
/**
53-
* only custom field
49+
* only custom field.
5450
*/
5551
const CUSTOM = 1;
5652

5753
/**
58-
* only system field
54+
* only system field.
5955
*/
6056
const SYSTEM = 2;
6157

6258
/**
63-
* both System and Custom
59+
* both System and Custom.
6460
*/
6561
const BOTH = 3;
6662

6763
public function setName($name)
6864
{
6965
$this->name = $name;
66+
7067
return $this;
7168
}
7269

7370
public function setDescription($description)
7471
{
7572
$this->description = $description;
73+
7674
return $this;
7775
}
7876

@@ -82,23 +80,27 @@ public function setDescription($description)
8280
* @see https://confluence.atlassian.com/jira064/changing-custom-field-types-720415917.html
8381
*
8482
* @param $type
83+
*
8584
* @return $this
8685
*/
8786
public function setType($type)
8887
{
8988
$this->type = $type;
89+
9090
return $this;
9191
}
9292

9393
/**
9494
* atlassian supplied poor documentation.
9595
*
9696
* @param $searcherKey
97+
*
9798
* @return $this
9899
*/
99100
public function setSearcherKey($searcherKey)
100101
{
101102
$this->searcherKey = $searcherKey;
103+
102104
return $this;
103105
}
104106

src/Field/FieldService.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ public function getAllFields($fieldType = Field::BOTH)
2424
// temp array
2525
$ar = [];
2626
if ($fieldType === Field::CUSTOM) {
27-
foreach($fields as $f) {
27+
foreach ($fields as $f) {
2828
if ($f->custom === true) {
2929
array_push($ar, $f);
3030
}
3131
}
3232
$fields = &$ar;
3333
} elseif ($fieldType === Field::SYSTEM) {
34-
foreach($fields as $f) {
34+
foreach ($fields as $f) {
3535
if ($f->custom === false) {
3636
array_push($ar, $f);
3737
}
@@ -65,10 +65,9 @@ public function create(Field $field)
6565
$ret = $this->exec($this->uri, $data, 'POST');
6666

6767
$cf = $this->json_mapper->map(
68-
json_decode($ret) , new Field()
68+
json_decode($ret), new Field()
6969
);
7070

7171
return $cf;
7272
}
73-
7473
}

src/Issue/Issue.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ public function jsonSerialize()
2828
return array_filter(get_object_vars($this));
2929
}
3030

31-
public function addCustomFields($data) {
31+
public function addCustomFields($data)
32+
{
3233
if ($this->fields) {
3334
$this->fields->addCustomFields($data);
3435
}

src/Issue/IssueField.php

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
namespace JiraRestApi\Issue;
44

5-
use JiraRestApi\Dumper;
6-
75
class IssueField implements \JsonSerializable
86
{
97
public function __construct($updateIssue = false)
@@ -55,9 +53,10 @@ public function setSummary($summary)
5553
}
5654

5755
/**
58-
* set issue reporter name
56+
* set issue reporter name.
5957
*
6058
* @param string $name
59+
*
6160
* @return $this
6261
*/
6362
public function setReporterName($name)
@@ -72,7 +71,7 @@ public function setReporterName($name)
7271
}
7372

7473
/**
75-
* set issue assignee name
74+
* set issue assignee name.
7675
*
7776
* @param string $name
7877
*
@@ -90,7 +89,7 @@ public function setAssigneeName($name)
9089
}
9190

9291
/**
93-
* set issue priority name
92+
* set issue priority name.
9493
*
9594
* @param string $name
9695
*
@@ -109,6 +108,7 @@ public function setPriorityName($name)
109108

110109
/**
111110
* @param string|null $description
111+
*
112112
* @return $this
113113
*/
114114
public function setDescription($description)
@@ -121,7 +121,7 @@ public function setDescription($description)
121121
}
122122

123123
/**
124-
* add a Affects version
124+
* add a Affects version.
125125
*
126126
* @param string $name
127127
*
@@ -141,7 +141,7 @@ public function addVersion($name)
141141
}
142142

143143
/**
144-
* add issue label
144+
* add issue label.
145145
*
146146
* @param string $label
147147
*
@@ -159,7 +159,7 @@ public function addLabel($label)
159159
}
160160

161161
/**
162-
* set issue type
162+
* set issue type.
163163
*
164164
* @param IssueType $name
165165
*
@@ -168,15 +168,13 @@ public function addLabel($label)
168168
public function setIssueType($name)
169169
{
170170
if (is_string($name)) {
171-
172171
if (is_null($this->issuetype)) {
173172
$this->issuetype = new \JiraRestApi\Issue\IssueType();
174173
}
175174

176175
$this->issuetype->name = $name;
177-
}
178-
else {
179-
$this->issuetype = $name;
176+
} else {
177+
$this->issuetype = $name;
180178
}
181179

182180
return $this;
@@ -188,11 +186,12 @@ public function getIssueType()
188186
}
189187

190188
/**
191-
* add custom field
189+
* add custom field.
192190
*
193191
* @param array $data
194192
*/
195-
public function addCustomFields($data) {
193+
public function addCustomFields($data)
194+
{
196195
foreach ($data as $key => $value) {
197196
if (substr($key, 0, 12) == 'customfield_') {
198197
$this->{$key} = $value;
@@ -201,21 +200,22 @@ public function addCustomFields($data) {
201200
}
202201

203202
/**
204-
* set parent issue
203+
* set parent issue.
205204
*
206205
* @param string $keyOrId
207206
*/
208-
public function setParentKeyOrId($keyOrId) {
207+
public function setParentKeyOrId($keyOrId)
208+
{
209209
if (is_numeric($keyOrId)) {
210210
$this->parent['id'] = $keyOrId;
211-
}
212-
elseif (is_string($keyOrId)) {
211+
} elseif (is_string($keyOrId)) {
213212
$this->parent['key'] = $keyOrId;
214213
}
215214
}
216215

217-
public function setParent(Issue $parent) {
218-
$this->parent = $parent;
216+
public function setParent(Issue $parent)
217+
{
218+
$this->parent = $parent;
219219
}
220220

221221
/** @var string */
@@ -331,5 +331,4 @@ public function setParent(Issue $parent) {
331331

332332
/** @var object|null */
333333
public $parent;
334-
335334
}

src/Issue/IssueSearchResult.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,8 @@ public function setIssues($issues)
105105
/**
106106
* @param int $ndx
107107
*/
108-
public function getIssue($ndx) {
108+
public function getIssue($ndx)
109+
{
109110
return $this->issues[$ndx];
110111
}
111112

0 commit comments

Comments
 (0)