-
-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #87 from andreaselia/2.0
2.0
- Loading branch information
Showing
17 changed files
with
693 additions
and
532 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: CS | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
tests: | ||
runs-on: ubuntu-latest | ||
name: Code Style | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Install Dependencies | ||
run: php /usr/bin/composer install -q --no-ansi --no-interaction --no-scripts --no-suggest --no-progress --prefer-dist | ||
- name: Verify | ||
run: php vendor/bin/pint --test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
namespace AndreasElia\PostmanGenerator\Authentication; | ||
|
||
use Illuminate\Contracts\Support\Arrayable; | ||
|
||
abstract class AuthenticationMethod implements Arrayable | ||
{ | ||
public function __construct(protected ?string $token = null) | ||
{ | ||
} | ||
|
||
public function toArray(): array | ||
{ | ||
return [ | ||
'key' => 'Authorization', | ||
'value' => sprintf('%s %s', $this->prefix(), $this->token ?? '{{token}}'), | ||
]; | ||
} | ||
|
||
public function getToken(): string | ||
{ | ||
return $this->token; | ||
} | ||
|
||
abstract public function prefix(): string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
namespace AndreasElia\PostmanGenerator\Authentication; | ||
|
||
class Basic extends AuthenticationMethod | ||
{ | ||
public function prefix(): string | ||
{ | ||
return 'Basic'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
namespace AndreasElia\PostmanGenerator\Authentication; | ||
|
||
class Bearer extends AuthenticationMethod | ||
{ | ||
public function prefix(): string | ||
{ | ||
return 'Bearer'; | ||
} | ||
} |
Oops, something went wrong.