-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
885 changed files
with
63,228 additions
and
26,957 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 @@ | ||
/.gitattributes export-ignore | ||
/.github export-ignore | ||
/.gitignore export-ignore | ||
/.jane-openapi-*.php export-ignore | ||
/CHANGELOG.md export-ignore | ||
/CONTRIBUTING.md export-ignore | ||
/doc export-ignore | ||
/Makefile export-ignore | ||
/phpunit.xml.dist export-ignore | ||
/resources export-ignore | ||
/tests export-ignore | ||
/VERSIONING.md export-ignore | ||
/.php-cs-fixer.php export-ignore | ||
/rector.php export-ignore | ||
/openapi-specs export-ignore |
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,20 @@ | ||
version: 2 | ||
|
||
updates: | ||
# Maintain dependencies for GitHub Actions | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "monthly" | ||
labels: | ||
- "github-actions" | ||
- "dependencies" | ||
|
||
# Maintain dependencies for Composer | ||
- package-ecosystem: "composer" | ||
directory: "/" | ||
schedule: | ||
interval: "monthly" | ||
labels: | ||
- "php" | ||
- "dependencies" |
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,19 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
|
||
jobs: | ||
check-cs: | ||
name: Coding Style | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: PHP-CS-Fixer | ||
uses: docker://oskarstark/php-cs-fixer-ga | ||
with: | ||
args: --config=.php-cs-fixer.php --diff --dry-run |
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,29 @@ | ||
name: Diff spec | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: '0 0 * * MON' | ||
|
||
jobs: | ||
check-spec: | ||
name: Check SDK is in sync with spec | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install dependencies | ||
run: composer update --no-interaction | ||
|
||
- name: Regenerate SDK library | ||
run: rm -rf generated && vendor/bin/jane-openapi generate --config-file=.jane-openapi.php | ||
|
||
- name: Rector | ||
run: vendor/bin/rector | ||
|
||
- name: Code style | ||
run: ./vendor/bin/php-cs-fixer fix | ||
|
||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v6 |
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 |
---|---|---|
@@ -1,15 +1,5 @@ | ||
# Dependencies | ||
/vendor | ||
|
||
# Composer | ||
composer.lock | ||
composer.phar | ||
|
||
# CS | ||
.php_cs.cache | ||
.php-cs-fixer.cache | ||
|
||
# tests | ||
phpunit.xml | ||
ci_generated | ||
.phpunit.result.cache |
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 |
---|---|---|
@@ -1,17 +1,17 @@ | ||
<?php | ||
|
||
$finder = PhpCsFixer\Finder::create()->in(__DIR__); | ||
$config = new PhpCsFixer\Config(); | ||
declare(strict_types=1); | ||
|
||
return $config | ||
$finder = PhpCsFixer\Finder::create() | ||
->in(__DIR__) | ||
; | ||
|
||
return (new PhpCsFixer\Config()) | ||
->setRiskyAllowed(true) | ||
->setRules([ | ||
'@PhpCsFixer' => true, | ||
'@Symfony' => true, | ||
'@Symfony:risky' => true, | ||
'@PHP71Migration' => true, | ||
'@PHP71Migration:risky' => true, | ||
'strict_param' => true, | ||
'array_syntax' => ['syntax' => 'short'], | ||
]) | ||
->setRiskyAllowed(true) | ||
->setFinder($finder) | ||
; |
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,21 @@ | ||
rector: ## Run rector (dry run) | ||
./vendor/bin/rector process --dry-run --verbose | ||
|
||
rectify: ## Run rector | ||
./vendor/bin/rector process | ||
|
||
cs: ## Fix code style (PHP CS Fixer) | ||
./vendor/bin/php-cs-fixer fix | ||
|
||
cs_check: ## Check code style | ||
./vendor/bin/php-cs-fixer check | ||
|
||
jane: ## Generate SDK | ||
./vendor/bin/jane-openapi generate --config-file=.jane-openapi.php | ||
|
||
.PHONY: help | ||
|
||
help: ## Display this help | ||
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' | ||
|
||
.DEFAULT_GOAL := help |
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 |
---|---|---|
@@ -1,2 +1,35 @@ | ||
# yousign-php-api | ||
PHP Yousign Client | ||
# PHP client for Yousign API | ||
|
||
This SDK is generated automatically with [JanePHP](https://github.com/janephp/janephp) | ||
from the [Yousign API](https://developers.yousign.com/). | ||
|
||
It also provides a **full object-oriented interface** for all the endpoints, | ||
requests and responses of the Yousign API. | ||
|
||
## Installation | ||
|
||
This library is built atop of [PSR-7](https://www.php-fig.org/psr/psr-7/) and | ||
[PSR-18](https://www.php-fig.org/psr/psr-18/). So you will need to install some | ||
implementations for those standard interfaces. | ||
|
||
If no PSR-18 client or PSR-7 message factory is available yet in your project | ||
or you don't know or don't care which one to use, just install some default: | ||
|
||
```bash | ||
composer require symfony/http-client nyholm/psr7 | ||
``` | ||
|
||
You can now install the Yousign client: | ||
|
||
```bash | ||
composer require qdequippe/yousign-php-api | ||
``` | ||
|
||
## Quick start | ||
|
||
To create a client: | ||
|
||
```php | ||
$client = \Qdequippe\Yousign\Api\Client::create(); | ||
$client->getSignatureRequests(); | ||
``` |
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 was deleted.
Oops, something went wrong.
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,28 @@ | ||
<?php | ||
|
||
namespace Qdequippe\Yousign\Api\Authentication; | ||
|
||
use Jane\Component\OpenApiRuntime\Client\AuthenticationPlugin; | ||
use Psr\Http\Message\RequestInterface; | ||
|
||
class BearerAuthAuthentication implements AuthenticationPlugin | ||
{ | ||
private $token; | ||
|
||
public function __construct(string $token) | ||
{ | ||
$this->{'token'} = $token; | ||
} | ||
|
||
public function authentication(RequestInterface $request): RequestInterface | ||
{ | ||
$header = sprintf('Bearer %s', $this->{'token'}); | ||
|
||
return $request->withHeader('Authorization', $header); | ||
} | ||
|
||
public function getScope(): string | ||
{ | ||
return 'bearerAuth'; | ||
} | ||
} |
Oops, something went wrong.