Skip to content

Commit df9ddc3

Browse files
authored
Merge pull request #226 from fbourigault/psr-2
Update coding standards to PSR-2.
2 parents a73719b + 2d5e5e3 commit df9ddc3

15 files changed

+78
-72
lines changed

.styleci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
preset: psr2

lib/Gitlab/Api/AbstractApi.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,11 +203,15 @@ protected function createOptionsResolver()
203203
$resolver = new OptionsResolver();
204204
$resolver->setDefined('page')
205205
->setAllowedTypes('page', 'int')
206-
->setAllowedValues('page', function ($value) { return $value > 0; })
206+
->setAllowedValues('page', function ($value) {
207+
return $value > 0;
208+
})
207209
;
208210
$resolver->setDefined('per_page')
209211
->setAllowedTypes('per_page', 'int')
210-
->setAllowedValues('per_page', function ($value) { return $value > 0 && $value <= 100; })
212+
->setAllowedValues('per_page', function ($value) {
213+
return $value > 0 && $value <= 100;
214+
})
211215
;
212216
$resolver->setDefined('sort')
213217
->setAllowedValues('sort', ['asc', 'desc'])
@@ -218,7 +222,6 @@ protected function createOptionsResolver()
218222

219223
private function preparePath($path, array $parameters = [])
220224
{
221-
222225
if (count($parameters) > 0) {
223226
$path .= '?'.QueryStringBuilder::build($parameters);
224227
}

lib/Gitlab/Api/Projects.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,15 +135,17 @@ public function remove($project_id)
135135
* @param int $project_id
136136
* @return mixed
137137
*/
138-
public function archive($project_id){
138+
public function archive($project_id)
139+
{
139140
return $this->post("projects/".$this->encodePath($project_id)."/archive");
140141
}
141142

142143
/**
143144
* @param int $project_id
144145
* @return mixed
145146
*/
146-
public function unarchive($project_id){
147+
public function unarchive($project_id)
148+
{
147149
return $this->post("projects/".$this->encodePath($project_id)."/unarchive");
148150
}
149151

lib/Gitlab/Api/Repositories.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,13 @@ public function createTag($project_id, $name, $ref, $message = null)
102102
*
103103
* @return mixed
104104
*/
105-
public function createRelease( $project_id, $tag_name, $description ) {
106-
return $this->post( $this->getProjectPath( $project_id, 'repository/tags/' . $this->encodeBranch( $tag_name ) . '/release' ), array(
105+
public function createRelease($project_id, $tag_name, $description)
106+
{
107+
return $this->post($this->getProjectPath($project_id, 'repository/tags/' . $this->encodeBranch($tag_name) . '/release'), array(
107108
'id' => $project_id,
108109
'tag_name' => $tag_name,
109110
'description' => $description
110-
) );
111+
));
111112
}
112113

113114
/**
@@ -117,12 +118,13 @@ public function createRelease( $project_id, $tag_name, $description ) {
117118
*
118119
* @return mixed
119120
*/
120-
public function updateRelease( $project_id, $tag_name, $description ) {
121-
return $this->put( $this->getProjectPath( $project_id, 'repository/tags/' . $this->encodeBranch( $tag_name ) . '/release' ), array(
121+
public function updateRelease($project_id, $tag_name, $description)
122+
{
123+
return $this->put($this->getProjectPath($project_id, 'repository/tags/' . $this->encodeBranch($tag_name) . '/release'), array(
122124
'id' => $project_id,
123125
'tag_name' => $tag_name,
124126
'description' => $description
125-
) );
127+
));
126128
}
127129

128130
/**

lib/Gitlab/Client.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ public function jobs()
162162
*/
163163
public function mergeRequests()
164164
{
165-
return new Api\MergeRequests($this);
165+
return new Api\MergeRequests($this);
166166
}
167167

168168
/**
@@ -194,7 +194,7 @@ public function projects()
194194
*/
195195
public function repositories()
196196
{
197-
return new Api\Repositories($this);
197+
return new Api\Repositories($this);
198198
}
199199

200200
/**

lib/Gitlab/Exception/ErrorException.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,4 @@
77
*/
88
class ErrorException extends \ErrorException
99
{
10-
1110
}

lib/Gitlab/Exception/InvalidArgumentException.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,4 @@
77
*/
88
class InvalidArgumentException extends \InvalidArgumentException
99
{
10-
1110
}

lib/Gitlab/Exception/RuntimeException.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,4 @@
77
*/
88
class RuntimeException extends \RuntimeException
99
{
10-
1110
}

lib/Gitlab/Exception/ValidationFailedException.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,4 @@
77
*/
88
class ValidationFailedException extends ErrorException
99
{
10-
1110
}

lib/Gitlab/Model/Group.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,8 @@ public function removeMember($user_id)
131131
*/
132132
public function projects()
133133
{
134-
135134
$data = $this->client->groups()->projects($this->id);
136135

137-
return Group::fromArray($this->getClient(),$data);
136+
return Group::fromArray($this->getClient(), $data);
138137
}
139138
}

0 commit comments

Comments
 (0)