Skip to content

Commit

Permalink
applied style ci
Browse files Browse the repository at this point in the history
  • Loading branch information
lesstif committed Jul 30, 2017
1 parent fc5401b commit c71f1fc
Show file tree
Hide file tree
Showing 35 changed files with 218 additions and 197 deletions.
4 changes: 2 additions & 2 deletions src/ClassSerialize.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ trait ClassSerialize
* class property to Array.
*
* @param array $ignoreProperties this properties to be (ex|in)cluded from array whether second param is true or false.
* @param boolean $excludeMode
* @param bool $excludeMode
*
* @return array
*/
Expand Down Expand Up @@ -36,7 +36,7 @@ public function toArray($ignoreProperties = [], $excludeMode = true)
* class property to String.
*
* @param array $ignoreProperties this properties to be excluded from String.
* @param boolean $excludeMode
* @param bool $excludeMode
*
* @return string
*/
Expand Down
3 changes: 2 additions & 1 deletion src/Dumper.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace JiraRestApi;

use Symfony\Component\VarDumper\Cloner\VarCloner;
use Symfony\Component\VarDumper\Dumper\CliDumper;
use Symfony\Component\VarDumper\Dumper\HtmlDumper;
use Symfony\Component\VarDumper\Cloner\VarCloner;

class Dumper
{
Expand All @@ -22,6 +22,7 @@ public static function dump($value)
var_dump($value);
}
}

public static function dd($x)
{
array_map(function ($x) {
Expand Down
1 change: 1 addition & 0 deletions src/Field/Field.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php

namespace JiraRestApi\Field;

use JiraRestApi\ClassSerialize;

/**
Expand Down
4 changes: 2 additions & 2 deletions src/Field/FieldService.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function getCustomFieldOption($id)
{
$ret = $this->exec('/customFieldOption', null);

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

return $ret;
}
Expand All @@ -60,7 +60,7 @@ public function create(Field $field)
{
$data = json_encode($field);

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

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

Expand Down
18 changes: 9 additions & 9 deletions src/Group/Group.php
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
<?php

namespace JiraRestApi\Group;

use JiraRestApi\ClassSerialize;

class GroupUser
{
/**
* @var integer
* @var int
*/
public $size;

/** @var array */
/** @var array */
public $items;

/** @var integer */
/** @var int */
public $max_results;

/** @var integer */
/** @var int */
public $start_index;

/** @var integer */
/** @var int */
public $end_index;
}

/**
* Class Group
* Class Group.
*
* @package JiraRestApi\Group
*
* @see https://docs.atlassian.com/jira/REST/server/#api/2/group
*/
Expand Down Expand Up @@ -61,10 +61,10 @@ public function jsonSerialize()
return array_filter(get_object_vars($this));
}

public function setName($name) {
public function setName($name)
{
$this->name = $name;

return $this;
}

}
12 changes: 6 additions & 6 deletions src/Group/GroupSearchResult.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php

namespace JiraRestApi\Group;

use JiraRestApi\ClassSerialize;

/**
* Class GroupSearchResult
* Class GroupSearchResult.
*
* @package JiraRestApi\Group
*
* @see https://docs.atlassian.com/jira/REST/server/#api/2/group
*/
Expand All @@ -22,21 +22,21 @@ class GroupSearchResult implements \JsonSerializable
public $self;

/**
* @var integer
* @var int
*/
public $maxResults;

/**
* @var integer
* @var int
*/
public $startAt;

/**
* @var integer
* @var int
*/
public $total;

/** @var \JiraRestApi\User\User[] */
/** @var \JiraRestApi\User\User[] */
public $values;

public function jsonSerialize()
Expand Down
33 changes: 20 additions & 13 deletions src/Group/GroupService.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

/**
* Class to perform all groups related queries.
* @package JiraRestApi\Group
*/
class GroupService extends \JiraRestApi\JiraClient
{
Expand All @@ -14,7 +13,7 @@ class GroupService extends \JiraRestApi\JiraClient
* Function to get group.
*
* @param array $paramArray Possible values for $paramArray 'username', 'key'.
* "Either the 'username' or the 'key' query parameters need to be provided".
* "Either the 'username' or the 'key' query parameters need to be provided".
*
* @return Group class
*/
Expand All @@ -32,18 +31,20 @@ public function get($paramArray)
}

/**
* Get users from group
* Get users from group.
*
* @param $paramArray groupname, includeInactiveUsers, startAt, maxResults
* @return GroupSearchResult
*
* @throws \JiraRestApi\JiraException
* @throws \JsonMapper_Exception
*
* @return GroupSearchResult
*/
public function getMembers($paramArray)
{
$queryParam = '?' . http_build_query($paramArray);
$queryParam = '?'.http_build_query($paramArray);

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

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

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

/**
* Creates a group by given group parameter
* Creates a group by given group parameter.
*
* @param $group \JiraRestApi\Group\Group
* @return array
*
* @throws \JiraRestApi\JiraException
* @throws \JsonMapper_Exception
*
* @return array
*/
public function createGroup($group)
{
Expand All @@ -84,15 +87,17 @@ public function createGroup($group)
* Adds given user to a group.
*
* @param $group
* @return Returns the current state of the group.
*
* @throws \JiraRestApi\JiraException
* @throws \JsonMapper_Exception
*
* @return Returns the current state of the group.
*/
public function addUserToGroup($groupName, $userName)
{
$data = json_encode(['name' => $userName,]);
$data = json_encode(['name' => $userName]);

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

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

Expand All @@ -108,15 +113,17 @@ public function addUserToGroup($groupName, $userName)
*
* @param $groupName
* @param $userName
* @return null Returns no content
*
* @throws \JiraRestApi\JiraException
* @throws \JsonMapper_Exception
*
* @return null Returns no content
*/
public function removeUserFromGroup($groupName, $userName)
{
$param = http_build_query(['groupname' => $groupName, 'username' => $userName]);

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

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

Expand Down
5 changes: 4 additions & 1 deletion src/Issue/Comment.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public function setType($type)
{
$this->type = $type;
}

public function setValue($value)
{
$this->value = $value;
Expand All @@ -20,6 +21,7 @@ public function getType()
{
return $this->type;
}

public function getValue()
{
return $this->value;
Expand Down Expand Up @@ -68,7 +70,8 @@ public function setBody($body)

/**
* @param Visibility $type
* @param null $value
* @param null $value
*
* @return $this
*/
public function setVisibility($type, $value = null)
Expand Down
7 changes: 4 additions & 3 deletions src/Issue/Component.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php namespace JiraRestApi\Issue;
<?php

namespace JiraRestApi\Issue;

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

public function jsonSerialize()
{
return array_filter(get_object_vars($this));
return array_filter(get_object_vars($this));
}
}
}
31 changes: 16 additions & 15 deletions src/Issue/IssueField.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public function __construct($updateIssue = false)

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

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

return $this;
}

public function setProjectId($id)
{
$this->project->id = $id;
Expand Down Expand Up @@ -158,13 +159,13 @@ public function setDescription($description)
public function addVersion($name)
{
if (is_null($this->versions)) {
$this->versions = array();
$this->versions = [];
}

if (is_string($name)){
if (is_string($name)) {
array_push($this->versions, new Version($name));
} else if (is_array($name)) {
foreach($name as $v) {
} elseif (is_array($name)) {
foreach ($name as $v) {
array_push($this->versions, new Version($v));
}
}
Expand All @@ -182,7 +183,7 @@ public function addVersion($name)
public function addLabel($label)
{
if (is_null($this->labels)) {
$this->labels = array();
$this->labels = [];
}

array_push($this->labels, $label);
Expand Down Expand Up @@ -246,13 +247,13 @@ public function setParent(Issue $parent)
public function addComponents($component)
{
if (is_null($this->components)) {
$this->components = array();
$this->components = [];
}

if (is_string($component)){
if (is_string($component)) {
array_push($this->components, new Component($component));
} else if (is_array($component)) {
foreach($component as $c) {
} elseif (is_array($component)) {
foreach ($component as $c) {
array_push($this->components, new Component($c));
}
}
Expand Down Expand Up @@ -302,7 +303,7 @@ public function addComponents($component)
/** @var string|null */
public $environment;

/** @var \JiraRestApi\Issue\Component[] */
/** @var \JiraRestApi\Issue\Component[] */
public $components;

/** @var Comments */
Expand Down Expand Up @@ -335,16 +336,16 @@ public function addComponents($component)
/** @var \JiraRestApi\Issue\Attachment[] */
public $attachment;

/** @var string|null */
/** @var string|null */
public $aggregatetimespent;

/** @var string|null */
/** @var string|null */
public $timeestimate;

/** @var string|null */
/** @var string|null */
public $aggregatetimeoriginalestimate;

/** @var string|null */
/** @var string|null */
public $resolutiondate;

/** @var \DateTime|null */
Expand Down
Loading

0 comments on commit c71f1fc

Please sign in to comment.