Skip to content

Ensure the code always respects PSR-2 #284

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 2, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true

[*.yml]
indent_style = space
indent_size = 2
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.php_cs.cache
phpunit.xml
composer.lock
composer.phar
Expand Down
14 changes: 14 additions & 0 deletions .php_cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

$finder = Symfony\CS\Finder\DefaultFinder::create()
->in(__DIR__);

$fixers = array(
'long_array_syntax',
);

return Symfony\CS\Config\Config::create()
->setUsingCache(true)
->level(Symfony\CS\FixerInterface::PSR2_LEVEL)
->fixers($fixers)
->finder($finder);
4 changes: 4 additions & 0 deletions .styleci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
preset: psr2

enabled:
- long_array_syntax
1 change: 0 additions & 1 deletion lib/Github/Api/ApiInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
*/
interface ApiInterface
{

public function getPerPage();

public function setPerPage($perPage);
Expand Down
21 changes: 11 additions & 10 deletions lib/Github/Api/Deployment.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Deployment extends AbstractApi
* @return array the deployments requested
*/
public function all($username, $repository, array $params = array())
{
{
return $this->get('repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/deployments', $params);
}

Expand All @@ -41,11 +41,11 @@ public function all($username, $repository, array $params = array())
*/
public function create($username, $repository, array $params)
{
if (!isset($params['ref'])) {
throw new MissingArgumentException(array('ref'));
}
if (!isset($params['ref'])) {
throw new MissingArgumentException(array('ref'));
}

return $this->post('repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/deployments', $params);
return $this->post('repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/deployments', $params);
}

/**
Expand All @@ -64,10 +64,10 @@ public function create($username, $repository, array $params)
*/
public function updateStatus($username, $repository, $id, array $params)
{
if (!isset($params['state'])) {
throw new MissingArgumentException(array('state'));
}
return $this->post('repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/deployments/'.rawurlencode($id).'/statuses', $params);
if (!isset($params['state'])) {
throw new MissingArgumentException(array('state'));
}
return $this->post('repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/deployments/'.rawurlencode($id).'/statuses', $params);
}

/**
Expand All @@ -78,7 +78,8 @@ public function updateStatus($username, $repository, $id, array $params)
* @param int $id the deployment identifier
* @return array the deployment statuses
*/
public function getStatuses($username, $repository, $id) {
public function getStatuses($username, $repository, $id)
{
return $this->get('repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/deployments/'.rawurlencode($id).'/statuses');
}
}
2 changes: 1 addition & 1 deletion lib/Github/Api/Gist/Comments.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ public function remove($gist, $comment)
{
return $this->delete('gists/'.rawurlencode($gist).'/comments/'.rawurlencode($comment));
}
}
}
4 changes: 2 additions & 2 deletions lib/Github/Api/Notification.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function all($includingRead = false, $participating = false, DateTime $si
'participating' => $participating
);

if($since !== null) {
if ($since !== null) {
$parameters['since'] = $since->format(DateTime::ISO8601);
}

Expand All @@ -51,7 +51,7 @@ public function markRead(DateTime $since = null)
{
$parameters = array();

if($since !== null) {
if ($since !== null) {
$parameters['last_read_at'] = $since->format(DateTime::ISO8601);
}

Expand Down
2 changes: 1 addition & 1 deletion lib/Github/Api/Repository/Releases.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Releases extends AbstractApi
*
* @param $username
* @param $repository
*
*
* @return array
*/
public function latest($username, $repository)
Expand Down
1 change: 0 additions & 1 deletion lib/Github/Api/Search.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
*/
class Search extends AbstractApi
{

/**
* Search repositories by filter (q).
*
Expand Down
2 changes: 1 addition & 1 deletion test/Github/Tests/Api/Enterprise/UserAdminTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ protected function getApiClass()
{
return 'Github\Api\Enterprise\UserAdmin';
}
}
}
2 changes: 1 addition & 1 deletion test/Github/Tests/Api/Gist/CommentsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,4 @@ protected function getApiClass()
{
return 'Github\Api\Gist\Comments';
}
}
}
2 changes: 1 addition & 1 deletion test/Github/Tests/Api/GistsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -242,4 +242,4 @@ protected function getApiClass()
{
return 'Github\Api\Gists';
}
}
}