Skip to content

Commit

Permalink
Merge 9daa326 into 11c80e8
Browse files Browse the repository at this point in the history
  • Loading branch information
MGatner committed Apr 21, 2022
2 parents 11c80e8 + 9daa326 commit ccf3f50
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ jobs:
env:
TERM: xterm-256color

- name: Check code for standards compliance
run: vendor/bin/php-cs-fixer fix --verbose --ansi --dry-run --using-cache=no --diff src/

- name: Run test suite
run: vendor/bin/phpunit --verbose
env:
Expand Down
3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"league/oauth2-client": "~2.3"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.4",
"phpstan/phpstan": "^1.5",
"phpunit/phpunit": "^9"
},
Expand All @@ -46,8 +47,10 @@
"ci": [
"Composer\\Config::disableProcessTimeout",
"@analyze",
"@style",
"@test"
],
"style": "php-cs-fixer fix --verbose --ansi --using-cache=no src/",
"test": "phpunit"
}
}
3 changes: 2 additions & 1 deletion src/Strava/API/OAuth.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

namespace Strava\API;

use League\OAuth2\Client\Token\AccessToken as AccessToken;
Expand Down Expand Up @@ -51,7 +52,7 @@ public function urlUserDetails()
*/
public function userDetails($response)
{
$user = new stdClass;
$user = new stdClass();

$user->uid = $response->id;
$user->name = implode(' ', [$response->firstname, $response->lastname]);
Expand Down
7 changes: 3 additions & 4 deletions src/Strava/API/Service/REST.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,12 @@ protected function getResponse($method, $path, $parameters)
$response = $this->adapter->request($method, $path, $parameters);
$result = $this->getResult($response);

if ($this->responseVerbosity === 0 && !is_string($result))
if ($this->responseVerbosity === 0 && !is_string($result)) {
return $result["body"];
}

return $result;
}
catch (\Exception $e) {
} catch (\Exception $e) {
throw new Exception('[SERVICE] ' . $e->getMessage());
}
}
Expand Down Expand Up @@ -587,5 +587,4 @@ public function getStreamsRoute($id)

return $this->getResponse('GET', $path, $parameters);
}

}
2 changes: 1 addition & 1 deletion src/Strava/API/Service/Stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ public function getRoute($id)
$json = '{"response": 1}';
return $this->format($json);
}

public function getRouteAsGPX($id)
{
$gpx = '<?xml version="1.0" encoding="UTF-8"?><gpx creator="StravaGPX"/>';
Expand Down

0 comments on commit ccf3f50

Please sign in to comment.