Skip to content
This repository has been archived by the owner on Jul 12, 2022. It is now read-only.

Commit

Permalink
Merge branch 'headers-update' of https://github.com/5pitf1re/seat-dis…
Browse files Browse the repository at this point in the history
…course into 5pitf1re/headers-update
  • Loading branch information
herpaderpaldent committed Apr 17, 2020
2 parents 83dca83 + 138ff2e commit fcb5487
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 18 deletions.
1 change: 0 additions & 1 deletion .styleci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ preset: laravel
risky: false

enabled:
- alpha_ordered_imports
- concat_with_spaces
- no_empty_comment

Expand Down
8 changes: 4 additions & 4 deletions src/Action/Discourse/Groups/Create.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@ class Create
* @return string
* @throws \Herpaderpaldent\Seat\SeatDiscourse\Exceptions\DiscourseGuzzleException
*/
public function execute(String $groupname) : string
public function execute(string $groupname): string
{
$client = new Client();
try {
$response = $client->request('POST', getenv('DISCOURSE_URL') . '/admin/groups', [
'form_params' => [
'group[name]' => $groupname
'group[name]' => $groupname,
],
'headers' => [
'api_key' => getenv('DISCOURSE_API_KEY'),
'api_username' => getenv('DISCOURSE_API_USERNAME'),
'api-key' => getenv('DISCOURSE_API_KEY'),
'api-username' => getenv('DISCOURSE_API_USERNAME'),
],
]);

Expand Down
4 changes: 2 additions & 2 deletions src/Action/Discourse/Groups/Delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ public function execute(int $group_id)
try {
$response = $client->request('DELETE', getenv('DISCOURSE_URL') . '/admin/groups/' . $group_id . '.json', [
'headers' => [
'api_key' => getenv('DISCOURSE_API_KEY'),
'api_username' => getenv('DISCOURSE_API_USERNAME'),
'api-key' => getenv('DISCOURSE_API_KEY'),
'api-username' => getenv('DISCOURSE_API_USERNAME'),
],
]);

Expand Down
6 changes: 3 additions & 3 deletions src/Action/Discourse/Groups/Get.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ class Get
* @return \Illuminate\Support\Collection
* @throws \Herpaderpaldent\Seat\SeatDiscourse\Exceptions\DiscourseGuzzleException
*/
public function execute() : Collection
public function execute(): Collection
{
$client = new Client();
try {
$response = $client->request('GET', getenv('DISCOURSE_URL') . '/groups/search.json', [
'headers' => [
'api_key' => getenv('DISCOURSE_API_KEY'),
'api_username' => getenv('DISCOURSE_API_USERNAME'),
'api-key' => getenv('DISCOURSE_API_KEY'),
'api-username' => getenv('DISCOURSE_API_USERNAME'),
],
]);

Expand Down
4 changes: 2 additions & 2 deletions src/Action/Discourse/Users/GetUserByCharacterId.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ public function execute(int $id)
try {
$response = $client->request('GET', getenv('DISCOURSE_URL') . '/users/by-external/' . $id . '.json', [
'headers' => [
'api_key' => getenv('DISCOURSE_API_KEY'),
'api_username' => getenv('DISCOURSE_API_USERNAME'),
'api-key' => getenv('DISCOURSE_API_KEY'),
'api-username' => getenv('DISCOURSE_API_USERNAME'),
],
]);

Expand Down
4 changes: 2 additions & 2 deletions src/Action/Discourse/Users/ListUsers.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ public function execute()
'show_emails' => 'true',
],
'headers' => [
'api_key' => getenv('DISCOURSE_API_KEY'),
'api_username' => getenv('DISCOURSE_API_USERNAME'),
'api-key' => getenv('DISCOURSE_API_KEY'),
'api-username' => getenv('DISCOURSE_API_USERNAME'),
],
]);

Expand Down
8 changes: 4 additions & 4 deletions src/Jobs/Logout.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ public function handle()
try {
$response = $this->client->request('POST', getenv('DISCOURSE_URL') . '/admin/users/' . $this->discourse_user_id . '/log_out', [
'headers' => [
'api_key' => getenv('DISCOURSE_API_KEY'),
'api_username' => getenv('DISCOURSE_API_USERNAME'),
'api-key' => getenv('DISCOURSE_API_KEY'),
'api-username' => getenv('DISCOURSE_API_USERNAME'),
],
]);

Expand All @@ -109,8 +109,8 @@ public function beforeStart()

$response = $this->client->request('GET', $uri, [
'headers' => [
'api_key' => getenv('DISCOURSE_API_KEY'),
'api_username' => getenv('DISCOURSE_API_USERNAME'),
'api-key' => getenv('DISCOURSE_API_KEY'),
'api-username' => getenv('DISCOURSE_API_USERNAME'),
],
]);

Expand Down

0 comments on commit fcb5487

Please sign in to comment.