Skip to content

Commit

Permalink
Fix CI: update php-cs-fixer (#106)
Browse files Browse the repository at this point in the history
* Fix CI: update php-cs-fixer

* Update chromedriver to version 88.0.4324.96

* Use dbrekelmans/bdi to detect drivers
  • Loading branch information
vincentchalamon authored Jan 28, 2021
1 parent a5ab67c commit cd56e5b
Show file tree
Hide file tree
Showing 17 changed files with 22 additions and 15 deletions.
6 changes: 6 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,12 @@ http://127.0.0.1:9080
http://127.0.0.1:9080/docusign/authorization_code/embedded_auth_code
http://127.0.0.1:9080/docusign/authorization_code/remote_auth_code

Detect and download the browser drivers automatically:

```shell
vendor/bin/bdi detect drivers
```

Then, run the following command to execute e2e tests:

```shell
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ jobs:
run: |
mkdir -p build/screenshots build/logs/phpunit
openssl aes-256-cbc -d -a -pbkdf2 -salt -in features/var/jwt/docusign.pem.enc -out features/var/jwt/docusign.pem -pass env:DOCUSIGN_RSA_PASSPHRASE
vendor/bin/bdi detect drivers
- name: Run PHPUnit tests with coverage
if: matrix.coverage
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@
/features/.env.*
!features/var/storage/dummy.pdf
/completed.pdf
/drivers/
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"webmozart/assert": "^1.5"
},
"require-dev": {
"dbrekelmans/bdi": "^0.3.0",
"doctrine/annotations": "^1.11",
"league/flysystem-bundle": "^1.2",
"nyholm/symfony-bundle-test": "dev-master",
Expand Down
2 changes: 1 addition & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<env name="KERNEL_CLASS" value="DocusignBundle\E2e\Kernel" />
<env name="SYMFONY_PHPUNIT_VERSION" value="9.4" />
<server name="PANTHER_WEB_SERVER_DIR" value="./features/public/" />
<server name="PANTHER_CHROME_DRIVER_BINARY" value="./tests/config/chromedriver" />
<server name="PANTHER_CHROME_DRIVER_BINARY" value="./drivers/chromedriver" />
<server name="PANTHER_NO_SANDBOX" value="1" />
</php>

Expand Down
3 changes: 1 addition & 2 deletions src/Controller/Callback.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@

final class Callback implements TranslatorAwareInterface
{
public const EVENT_COMPLETE = 'signing_complete';

use TranslatorAwareTrait;
public const EVENT_COMPLETE = 'signing_complete';

public function __invoke(Request $request, EventDispatcherInterface $eventDispatcher): Response
{
Expand Down
2 changes: 1 addition & 1 deletion src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public function getConfigTreeBuilder(): TreeBuilder
->validate()
->ifString()
->then(static function ($v) {
@trigger_error('The "grant_type" configuration key has been deprecated since 5.3.0 and will be removed in 6.0. Implicit authentication should not be used in this bundle.', E_USER_DEPRECATED);
@trigger_error('The "grant_type" configuration key has been deprecated since 5.3.0 and will be removed in 6.0. Implicit authentication should not be used in this bundle.', \E_USER_DEPRECATED);

return $v;
})
Expand Down
2 changes: 1 addition & 1 deletion src/DependencyInjection/DocusignExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public function load(array $configs, ContainerBuilder $container): void
// Clickwrap mode
if (EnvelopeBuilder::MODE_CLICKWRAP === $value['mode']) {
$clickwrapExtensionDefinition->addMethodCall('addConfig', [$name, $value['demo'], [
'environment' => pathinfo($value['api_uri'], PATHINFO_DIRNAME),
'environment' => pathinfo($value['api_uri'], \PATHINFO_DIRNAME),
'accountId' => $value['auth_clickwrap']['api_account_id'],
'clientUserId' => $value['auth_clickwrap']['user_guid'],
'clickwrapId' => $value['auth_clickwrap']['clickwrap_id'],
Expand Down
3 changes: 1 addition & 2 deletions src/EnvelopeCreator/DefineEnvelope.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@

final class DefineEnvelope implements EnvelopeBuilderCallableInterface, TranslatorAwareInterface
{
public const EMAIL_SUBJECT = 'Please sign this document';

use TranslatorAwareTrait;
public const EMAIL_SUBJECT = 'Please sign this document';

private $router;
private $envelopeBuilder;
Expand Down
2 changes: 1 addition & 1 deletion src/EnvelopeCreator/GetViewUrl.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
use DocusignBundle\Utils\CallbackRouteGenerator;
use Symfony\Component\Routing\RouterInterface;

/*final */class GetViewUrl implements EnvelopeBuilderCallableInterface
/*final */ class GetViewUrl implements EnvelopeBuilderCallableInterface
{
private $router;
private $envelopeBuilder;
Expand Down
4 changes: 2 additions & 2 deletions src/Grant/JwtGrant.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ private function createToken(): string
->relatedTo($this->userGuid) // sub
->issuedAt($time) // iat
->expiresAt($time->modify("$this->ttl sec")) // exp
->permittedFor(parse_url($this->accountApiUri, PHP_URL_HOST)) // aud
->permittedFor(parse_url($this->accountApiUri, \PHP_URL_HOST)) // aud
->withClaim('scope', 'signature impersonation') // scope
->getToken($config->signer(), $config->signingKey())
->toString();
Expand All @@ -101,7 +101,7 @@ private function createToken(): string
->relatedTo($this->userGuid) // sub
->issuedAt($time) // iat
->expiresAt($time + $this->ttl) // exp
->permittedFor(parse_url($this->accountApiUri, PHP_URL_HOST)) // aud
->permittedFor(parse_url($this->accountApiUri, \PHP_URL_HOST)) // aud
->withClaim('scope', 'signature impersonation') // scope
->getToken(new Sha256(), new Key("file://$this->privateKey"));
}
Expand Down
2 changes: 1 addition & 1 deletion src/TokenEncoder/TokenEncoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function encode(array $parameters): string

return password_hash(http_build_query($parameters + [
'integration_key' => $this->integrationKey,
]), PASSWORD_BCRYPT);
]), \PASSWORD_BCRYPT);
}

public function isTokenValid(array $parameters, ?string $token): bool
Expand Down
2 changes: 1 addition & 1 deletion tests/EmbeddedAuthCodeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,6 @@ public function testICanSignAnEmbeddedDocument(): void
$crawler = $client->waitFor('.alert');

$this->assertSame('The document has been successfully signed!', $crawler->filter('.alert')->text());
$this->assertSame('/embedded_auth_code', parse_url($crawler->getUri(), PHP_URL_PATH));
$this->assertSame('/embedded_auth_code', parse_url($crawler->getUri(), \PHP_URL_PATH));
}
}
2 changes: 1 addition & 1 deletion tests/EmbeddedTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,6 @@ public function testICanSignAnEmbeddedDocument(): void
$crawler = $client->waitFor('.alert');

$this->assertSame('The document has been successfully signed!', $crawler->filter('.alert')->text());
$this->assertSame('/embedded', parse_url($crawler->getUri(), PHP_URL_PATH));
$this->assertSame('/embedded', parse_url($crawler->getUri(), \PHP_URL_PATH));
}
}
2 changes: 1 addition & 1 deletion tests/RemoteAuthCodeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,6 @@ public function testICanSentARemoteDocumentToBeSigned(): void
$crawler = $client->waitFor('.alert');

$this->assertSame('The document has been successfully sent to the signer!', $crawler->filter('.alert')->text());
$this->assertSame('/remote_auth_code', parse_url($crawler->getUri(), PHP_URL_PATH));
$this->assertSame('/remote_auth_code', parse_url($crawler->getUri(), \PHP_URL_PATH));
}
}
2 changes: 1 addition & 1 deletion tests/RemoteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,6 @@ public function testICanSentARemoteDocumentToBeSigned(): void
$crawler = $client->waitFor('.alert');

$this->assertSame('The document has been successfully sent to the signer!', $crawler->filter('.alert')->text());
$this->assertSame('/remote', parse_url($crawler->getUri(), PHP_URL_PATH));
$this->assertSame('/remote', parse_url($crawler->getUri(), \PHP_URL_PATH));
}
}
Binary file removed tests/config/chromedriver
Binary file not shown.

0 comments on commit cd56e5b

Please sign in to comment.