From 02d6b2699138a0853b5dd10fee108c2f2d5631e5 Mon Sep 17 00:00:00 2001
From: Mark Trapp
Date: Sun, 27 Sep 2020 14:06:45 -0700
Subject: [PATCH 01/18] Update dependencies to support PHP 7.4
---
.editorconfig | 2 +-
.gitignore | 1 +
.travis.yml | 40 +++++++++++++++++--
Makefile | 8 ++--
README.md | 2 +-
composer.json | 31 +++++++-------
phpunit.xml.dist | 5 ++-
src/RequestSignerInterface.php | 4 +-
src/Symfony/HmacAuthenticationListener.php | 12 +++---
src/Symfony/HmacResponseListener.php | 6 +--
test/AcquiaSpecTest.php | 12 +++---
test/AuthorizationHeaderTest.php | 26 ++++++------
test/DigestTest.php | 2 +-
test/GuzzleAuthMiddlewareTest.php | 16 ++++----
test/RequestAuthenticatorTest.php | 27 +++++++------
test/RequestSignerTest.php | 6 +--
test/ResponseAuthenticatorTest.php | 8 ++--
.../HmacAuthenticationEntryPointTest.php | 2 +-
.../HmacAuthenticationListenerTest.php | 14 +++----
.../HmacAuthenticationProviderTest.php | 7 ++--
test/Symfony/HmacResponseListenerTest.php | 8 ++--
21 files changed, 140 insertions(+), 99 deletions(-)
diff --git a/.editorconfig b/.editorconfig
index 6d040c5..b0335b7 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -10,7 +10,7 @@ charset = utf-8
indent_style = space
indent_size = 4
-[*.{xml,yml,yaml}]
+[*.{xml,xml.*,yml,yaml}]
indent_size = 2
[Makefile]
diff --git a/.gitignore b/.gitignore
index 8fc51ed..5c1f3f9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,6 +13,7 @@ composer.lock
# Ignore local PHPUnit configuration
/phpunit.xml
+/.phpunit.result.cache
# Ignore PHP-CS-Fixer files
/.php_cs
diff --git a/.travis.yml b/.travis.yml
index 48e911b..7619d9e 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -7,19 +7,51 @@
language: php
php:
+ - 7.4
- 7.3
- 7.2
- - 7.1
- - 7.0
- - 5.6
+
+env:
+ - DIACTOROS_VERSION=2.4
+ - DIACTOROS_VERSION=2.3
+ - DIACTOROS_VERSION=2.2
+ - DIACTOROS_VERSION=2.1
+ - DIACTOROS_VERSION=2.0
+ - DIACTOROS_VERSION=1.9
+ - DIACTOROS_VERSION=1.8
+ - PSR_MESSAGE_BRIDGE_VERSION=2.0
+ - PSR_MESSAGE_BRIDGE_VERSION=1.2
+ - PSR_MESSAGE_BRIDGE_VERSION=1.1
+ - SYMFONY_VERSION=5.1
+ - SYMFONY_VERSION=5.0
+ - SYMFONY_VERSION=4.0
+ - SYMFONY_VERSION=4.4
+ - SYMFONY_VERSION=4.3
+ - SYMFONY_VERSION=4.2
+ - SYMFONY_VERSION=4.1
+ - SYMFONY_VERSION=4.0
+ - SYMFONY_VERSION=3.4
+ - SYMFONY_VERSION=3.3
+ - SYMFONY_VERSION=3.2
+ - SYMFONY_VERSION=3.1
+ - SYMFONY_VERSION=3.0
before_install:
- travis_retry composer self-update
- phpenv config-rm xdebug.ini
- echo "memory_limit=2G" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
-before_script:
+install:
+ - composer require "laminas/laminas-diactoros:${DIACTOROS_VERSION}" --no-update
+ - composer require "symfony/psr-http-message-bridge:${PSR_MESSAGE_BRIDGE_VERSION}" --no-update
+ - composer require "symfony/security-bundle:${SYMFONY_VERSION}" --no-update
- travis_retry make install
script:
- make test
+
+jobs:
+ include:
+ - stage: coverage
+ script: make coverage
+ env: DIACTOROS_VERSION=2.4 PSR_MESSAGE_BRIDGE_VERSION=2.0 SYMFONY_VERSION=5.1
diff --git a/Makefile b/Makefile
index 2cd4a77..b8a8e9e 100644
--- a/Makefile
+++ b/Makefile
@@ -4,17 +4,17 @@ install:
composer install --no-interaction
clean:
- rm -rf vendor/ dist/
+ rm -rf vendor/ dist/ composer.lock .php_cs.cache .phpunit.result.cache
-test: install
+test: install format
./vendor/bin/phpunit
- ./vendor/bin/php-cs-fixer fix --dry-run -v
./vendor/bin/phpmd src/,test/ text ./phpmd.xml
./vendor/bin/phpcpd src/ test/
./vendor/bin/phploc src/
coverage: install
- ./vendor/bin/phpunit --coverage-clover=dist/tests.clover
+ phpdbg ./vendor/bin/phpunit --coverage-clover dist/tests.clover
+ ./vendor/bin/coveralls -v --coverage_clover='./dist/tests.clover'
update:
composer update --no-interaction
diff --git a/README.md b/README.md
index b3c725d..cfe9f00 100644
--- a/README.md
+++ b/README.md
@@ -14,7 +14,7 @@ Use [Composer](http://getcomposer.org) and add it as a dependency to your projec
```json
{
"require": {
- "acquia/http-hmac-php": "^4.0"
+ "acquia/http-hmac-php": "^5.0"
}
}
```
diff --git a/composer.json b/composer.json
index 498f837..4420766 100644
--- a/composer.json
+++ b/composer.json
@@ -14,26 +14,27 @@
"issues": "https://github.com/acquia/http-hmac-php/issues"
},
"require": {
- "php": "~5.6 || ~7.0",
- "psr/http-message": "~1.0.0"
+ "php": "^7.2",
+ "psr/http-message": "^1.0"
},
"suggest": {
- "guzzlehttp/guzzle": "~6.0",
- "symfony/psr-http-message-bridge": "^1.1.2 | ^2.0",
- "symfony/security": "^3.0 | ^4.0",
- "laminas/laminas-diactoros": "^1.8 || ^2.2"
+ "guzzlehttp/guzzle": "^6.0",
+ "laminas/laminas-diactoros": "^1.8 || ^2.2",
+ "symfony/psr-http-message-bridge": "^1.1.2 || ^2.0",
+ "symfony/security": "^3.0 || ^4.0 || ^5.0"
},
"require-dev": {
- "guzzlehttp/guzzle": "~6.0",
- "phploc/phploc": "^4.0",
+ "friendsofphp/php-cs-fixer": "^2.16",
+ "guzzlehttp/guzzle": "^6.0",
+ "laminas/laminas-diactoros": "^1.8 || ^2.2",
+ "php-coveralls/php-coveralls": "^2.2",
+ "phploc/phploc": "^5.0",
"phpmd/phpmd": "^2.0",
- "phpunit/phpunit": "~5.7",
- "sebastian/phpcpd": "^2.0",
- "friendsofphp/php-cs-fixer": "^2.11",
- "symfony/psr-http-message-bridge": "^1.1.2 | ^2.0",
- "symfony/security": "^3.0 | ^4.0",
- "symfony/security-bundle": "^3.0 | ^4.0",
- "laminas/laminas-diactoros": "^1.8 || ^2.2"
+ "phpunit/phpunit": "^8.0",
+ "sebastian/phpcpd": "^4.0",
+ "symfony/phpunit-bridge": "^3.0 || ^4.0 || ^5.0",
+ "symfony/psr-http-message-bridge": "^1.1.2 || ^2.0",
+ "symfony/security-bundle": "^3.0 || ^4.0 || ^5.0"
},
"replace": {
"acquia/hmac-request": "self.version"
diff --git a/phpunit.xml.dist b/phpunit.xml.dist
index 42dc9cb..b72d976 100644
--- a/phpunit.xml.dist
+++ b/phpunit.xml.dist
@@ -1,12 +1,15 @@
./test
+
+
+
src/
diff --git a/src/RequestSignerInterface.php b/src/RequestSignerInterface.php
index 718a22e..1888b60 100644
--- a/src/RequestSignerInterface.php
+++ b/src/RequestSignerInterface.php
@@ -39,8 +39,8 @@ public function getTimestampedRequest(RequestInterface $request, \DateTime $date
/**
* Adds a hashed a hash for the request body.
*
- * @param \Acquia\Hmac\KeyInterface $key
- * The request for which to generate the hashed Body.
+ * @param \Psr\Http\Message\RequestInterface $request
+ * The request being signed.
*
* @return \Psr\Http\Message\RequestInterface $request
* A cloned request. If the request has a body, the
diff --git a/src/Symfony/HmacAuthenticationListener.php b/src/Symfony/HmacAuthenticationListener.php
index 34d9476..b6d1881 100644
--- a/src/Symfony/HmacAuthenticationListener.php
+++ b/src/Symfony/HmacAuthenticationListener.php
@@ -2,17 +2,16 @@
namespace Acquia\Hmac\Symfony;
-use Symfony\Component\HttpKernel\Event\GetResponseEvent;
+use Symfony\Component\HttpKernel\Event\RequestEvent;
use Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
use Symfony\Component\Security\Core\Exception\AuthenticationException;
use Symfony\Component\Security\Http\EntryPoint\AuthenticationEntryPointInterface;
-use Symfony\Component\Security\Http\Firewall\ListenerInterface;
/**
* Handles an authentication event.
*/
-class HmacAuthenticationListener implements ListenerInterface
+class HmacAuthenticationListener
{
/**
* @var \Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface
@@ -50,9 +49,12 @@ public function __construct(TokenStorageInterface $tokenStorage, AuthenticationM
}
/**
- * {@inheritDoc}
+ * Handles the incoming request.
+ *
+ * @param \Symfony\Component\HttpKernel\Event\RequestEvent $event
+ * The event corresponding to the request.
*/
- public function handle(GetResponseEvent $event)
+ public function __invoke(RequestEvent $event)
{
$request = $event->getRequest();
diff --git a/src/Symfony/HmacResponseListener.php b/src/Symfony/HmacResponseListener.php
index 1cc0e3d..889f1da 100644
--- a/src/Symfony/HmacResponseListener.php
+++ b/src/Symfony/HmacResponseListener.php
@@ -10,7 +10,7 @@
use Symfony\Bridge\PsrHttpMessage\Factory\DiactorosFactory;
use Symfony\Bridge\PsrHttpMessage\Factory\PsrHttpFactory;
use Symfony\Bridge\PsrHttpMessage\Factory\HttpFoundationFactory;
-use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
+use Symfony\Component\HttpKernel\Event\ResponseEvent;
use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
@@ -20,9 +20,9 @@
class HmacResponseListener implements EventSubscriberInterface
{
/**
- * @param FilterResponseEvent $event
+ * @param \Symfony\Component\HttpKernel\Event\ResponseEvent $event
*/
- public function onKernelResponse(FilterResponseEvent $event)
+ public function onKernelResponse(ResponseEvent $event)
{
if (!$event->isMasterRequest()) {
return;
diff --git a/test/AcquiaSpecTest.php b/test/AcquiaSpecTest.php
index 2feddc6..78a8d65 100644
--- a/test/AcquiaSpecTest.php
+++ b/test/AcquiaSpecTest.php
@@ -24,7 +24,7 @@ class AcquiaSpecTest extends TestCase
/**
* {@inheritDoc}
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->keys = [
'efdde334-fe7b-11e4-a322-1697f925ec7b' => 'W5PeGMxSItNerkNFqQMfYiJvH14WzVJMy54CPoTAYoI=',
@@ -76,11 +76,11 @@ public function testSpec($input, $expectations)
$signedAuthHeader = $signedRequest->getHeaderLine('Authorization');
- $this->assertContains('id="' . $input['id'] . '"', $signedAuthHeader);
- $this->assertContains('nonce="' . $input['nonce'] . '"', $signedAuthHeader);
- $this->assertContains('realm="' . rawurlencode($input['realm']) . '"', $signedAuthHeader);
- $this->assertContains('signature="' . $expectations['message_signature'] . '"', $signedAuthHeader);
- $this->assertContains('version="2.0"', $signedAuthHeader);
+ $this->assertStringContainsString('id="' . $input['id'] . '"', $signedAuthHeader);
+ $this->assertStringContainsString('nonce="' . $input['nonce'] . '"', $signedAuthHeader);
+ $this->assertStringContainsString('realm="' . rawurlencode($input['realm']) . '"', $signedAuthHeader);
+ $this->assertStringContainsString('signature="' . $expectations['message_signature'] . '"', $signedAuthHeader);
+ $this->assertStringContainsString('version="2.0"', $signedAuthHeader);
// Prove that the digest generates the correct signature.
$signedMessage = $digest->sign($expectations['signable_message'], $input['secret']);
diff --git a/test/AuthorizationHeaderTest.php b/test/AuthorizationHeaderTest.php
index 73dc048..ced5cee 100644
--- a/test/AuthorizationHeaderTest.php
+++ b/test/AuthorizationHeaderTest.php
@@ -23,7 +23,7 @@ class AuthorizationHeaderTest extends TestCase
/**
* {@inheritDoc}
*/
- protected function setUp()
+ protected function setUp(): void
{
// @codingStandardsIgnoreStart
$this->header = 'acquia-http-hmac headers="X-Custom-Signer1;X-Custom-Signer2",id="e7fe97fa-a0c8-4a42-ab8e-2c26d52df059",nonce="a9938d07-d9f0-480c-b007-f1e956bcd027",realm="CIStore",signature="0duvqeMauat7pTULg3EgcSmBjrorrcRkGKxRDtZEa1c=",version="2.0"';
@@ -113,14 +113,14 @@ public function testCaseInsensitiveRequestMethod()
/**
* Ensures an exception is thrown if a request does not have an Authorization header.
- *
- * @expectedException \Acquia\Hmac\Exception\MalformedRequestException
- * @expectedExceptionMessage Authorization header is required.
*/
public function testCreateFromRequestNoAuthorizationHeader()
{
$request = new Request('GET', 'http://example.com');
+ $this->expectException(MalformedRequestException::class);
+ $this->expectExceptionMessage('Authorization header is required.');
+
try {
AuthorizationHeader::createFromRequest($request);
} catch (MalformedRequestException $e) {
@@ -136,9 +136,6 @@ public function testCreateFromRequestNoAuthorizationHeader()
* The authorization header field.
*
* @dataProvider requiredFieldsProvider
- *
- * @expectedException \Acquia\Hmac\Exception\MalformedRequestException
- * @expectedExceptionMessage Authorization header requires a realm, id, version, nonce and a signature.
*/
public function testParseAuthorizationHeaderRequiredFields($field)
{
@@ -147,6 +144,9 @@ public function testParseAuthorizationHeaderRequiredFields($field)
];
$request = new Request('GET', 'http://example.com', $headers);
+ $this->expectException(MalformedRequestException::class);
+ $this->expectExceptionMessage('Authorization header requires a realm, id, version, nonce and a signature.');
+
try {
AuthorizationHeader::createFromRequest($request);
} catch (MalformedRequestException $e) {
@@ -171,9 +171,6 @@ public function requiredFieldsProvider()
/**
* Ensures an exception is thrown when a required field is missing.
- *
- * @expectedException \Acquia\Hmac\Exception\MalformedRequestException
- * @expectedExceptionMessage One or more required authorization header fields (ID, nonce, realm, version) are missing.
*/
public function testAuthorizationHeaderBuilderRequiresFields()
{
@@ -187,6 +184,9 @@ public function testAuthorizationHeaderBuilderRequiresFields()
$builder->setNonce('a9938d07-d9f0-480c-b007-f1e956bcd027');
$builder->setVersion('2.0');
+ $this->expectException(MalformedRequestException::class);
+ $this->expectExceptionMessage('One or more required authorization header fields (ID, nonce, realm, version) are missing.');
+
try {
$builder->getAuthorizationHeader();
} catch (MalformedRequestException $e) {
@@ -197,9 +197,6 @@ public function testAuthorizationHeaderBuilderRequiresFields()
/**
* Ensures an exception is thrown when the required X-Authorization-Timestamp field is missing.
- *
- * @expectedException \Acquia\Hmac\Exception\MalformedRequestException
- * @expectedExceptionMessage X-Authorization-Timestamp header missing from request.
*/
public function testAuthorizationHeaderBuilderRequiresTimestamp()
{
@@ -213,6 +210,9 @@ public function testAuthorizationHeaderBuilderRequiresTimestamp()
$builder->setNonce('a9938d07-d9f0-480c-b007-f1e956bcd027');
$builder->setVersion('2.0');
+ $this->expectException(MalformedRequestException::class);
+ $this->expectExceptionMessage('X-Authorization-Timestamp header missing from request.');
+
try {
$builder->getAuthorizationHeader();
} catch (MalformedRequestException $e) {
diff --git a/test/DigestTest.php b/test/DigestTest.php
index ef2af56..53aecbc 100644
--- a/test/DigestTest.php
+++ b/test/DigestTest.php
@@ -25,7 +25,7 @@ class DigestTest extends TestCase
/**
* {@inheritDoc}
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->authSecret = 'TXkgU2VjcmV0IEtleSBUaGF0IGlzIFZlcnkgU2VjdXJl';
$this->message = 'The quick brown fox jumps over the lazy dog.';
diff --git a/test/GuzzleAuthMiddlewareTest.php b/test/GuzzleAuthMiddlewareTest.php
index ec2323b..3b8b37d 100644
--- a/test/GuzzleAuthMiddlewareTest.php
+++ b/test/GuzzleAuthMiddlewareTest.php
@@ -26,7 +26,7 @@ class GuzzleAuthMiddlewareTest extends TestCase
*/
protected $authKey;
- protected function setUp()
+ protected function setUp(): void
{
$authId = 'efdde334-fe7b-11e4-a322-1697f925ec7b';
$authSecret = 'W5PeGMxSItNerkNFqQMfYiJvH14WzVJMy54CPoTAYoI=';
@@ -97,9 +97,6 @@ public function testAuthorizationHeader()
/**
* Ensures the middleware throws an exception if the response is missing the right header.
- *
- * @expectedException \Acquia\Hmac\Exception\MalformedResponseException
- * @expectedExceptionMessage Response is missing required X-Server-Authorization-HMAC-SHA256 header.
*/
public function testMissingRequiredResponseHeader()
{
@@ -111,6 +108,9 @@ public function testMissingRequiredResponseHeader()
'handler' => $stack,
]);
+ $this->expectException(MalformedResponseException::class);
+ $this->expectExceptionMessage('Response is missing required X-Server-Authorization-HMAC-SHA256 header.');
+
try {
$client->get('http://example.com');
} catch (MalformedResponseException $e) {
@@ -124,11 +124,6 @@ public function testMissingRequiredResponseHeader()
*/
public function testInauthenticResponse()
{
- $this->setExpectedException(
- '\Acquia\Hmac\Exception\MalformedResponseException',
- 'Could not verify the authenticity of the response.'
- );
-
$headers = [
'X-Server-Authorization-HMAC-SHA256' => 'bad-signature',
];
@@ -144,6 +139,9 @@ public function testInauthenticResponse()
'handler' => $stack,
]);
+ $this->expectException(MalformedResponseException::class);
+ $this->expectExceptionMessage('Could not verify the authenticity of the response.');
+
try {
$client->get('http://example.com');
} catch (MalformedResponseException $e) {
diff --git a/test/RequestAuthenticatorTest.php b/test/RequestAuthenticatorTest.php
index aec39e5..9aa54ee 100644
--- a/test/RequestAuthenticatorTest.php
+++ b/test/RequestAuthenticatorTest.php
@@ -3,7 +3,10 @@
namespace Acquia\Hmac\Test;
use Acquia\Hmac\AuthorizationHeader;
+use Acquia\Hmac\Exception\InvalidSignatureException;
+use Acquia\Hmac\Exception\KeyNotFoundException;
use Acquia\Hmac\Exception\MalformedRequestException;
+use Acquia\Hmac\Exception\TimestampOutOfRangeException;
use Acquia\Hmac\KeyInterface;
use Acquia\Hmac\RequestAuthenticator;
use Acquia\Hmac\Test\Mocks\MockKeyLoader;
@@ -24,7 +27,7 @@ class RequestAuthenticatorTest extends TestCase
/**
* {@inheritDoc}
*/
- protected function setUp()
+ protected function setUp(): void
{
$this->keys = [
'efdde334-fe7b-11e4-a322-1697f925ec7b' => 'W5PeGMxSItNerkNFqQMfYiJvH14WzVJMy54CPoTAYoI=',
@@ -72,8 +75,6 @@ public function testValidSignature()
/**
* Ensures an exception is thrown if the signature is invalid.
- *
- * @expectedException \Acquia\Hmac\Exception\InvalidSignatureException
*/
public function testInvalidSignature()
{
@@ -104,6 +105,8 @@ public function testInvalidSignature()
'bad-sig'
);
+ $this->expectException(InvalidSignatureException::class);
+
$authenticator = new MockRequestAuthenticator(
new MockKeyLoader($this->keys),
$authHeader
@@ -113,8 +116,6 @@ public function testInvalidSignature()
/**
* Ensures an exception is thrown if the request has expired.
- *
- * @expectedException \Acquia\Hmac\Exception\TimestampOutOfRangeException
*/
public function testExpiredRequest()
{
@@ -133,6 +134,8 @@ public function testExpiredRequest()
$request = new Request('GET', 'https://example.com/test', $headers);
$authHeader = AuthorizationHeader::createFromRequest($request);
+ $this->expectException(TimestampOutOfRangeException::class);
+
$authenticator = new MockRequestAuthenticator(
new MockKeyLoader($this->keys),
$authHeader
@@ -142,8 +145,6 @@ public function testExpiredRequest()
/**
* Ensures an exception is thrown if the request is from the far future.
- *
- * @expectedException \Acquia\Hmac\Exception\TimestampOutOfRangeException
*/
public function testFutureRequest()
{
@@ -165,14 +166,14 @@ public function testFutureRequest()
$request = new Request('GET', 'https://example.com/test', $headers);
+ $this->expectException(TimestampOutOfRangeException::class);
+
$authenticator = new RequestAuthenticator(new MockKeyLoader($this->keys));
$authenticator->authenticate($request);
}
/**
* Ensures an exception is thrown if the key cannot be found in the loader.
- *
- * @expectedException \Acquia\Hmac\Exception\KeyNotFoundException
*/
public function testKeyNotFound()
{
@@ -188,15 +189,14 @@ public function testKeyNotFound()
];
$request = new Request('GET', 'https://example.com/test', $headers);
+ $this->expectException(KeyNotFoundException::class);
+
$authenticator = new RequestAuthenticator(new MockKeyLoader($this->keys));
$authenticator->authenticate($request);
}
/**
* Ensures an exception is thrown if the request is missing the X-Authorization-Timestamp header.
- *
- * @expectedException \Acquia\Hmac\Exception\MalformedRequestException
- * @expectedExceptionMessage Request is missing X-Authorization-Timestamp.
*/
public function testMissingAuthenticationTimestampHeader()
{
@@ -211,6 +211,9 @@ public function testMissingAuthenticationTimestampHeader()
];
$request = new Request('GET', 'https://example.com/test', $headers);
+ $this->expectException(MalformedRequestException::class);
+ $this->expectExceptionMessage('Request is missing X-Authorization-Timestamp.');
+
$authenticator = new RequestAuthenticator(new MockKeyLoader($this->keys));
try {
diff --git a/test/RequestSignerTest.php b/test/RequestSignerTest.php
index 0f3139a..5731397 100644
--- a/test/RequestSignerTest.php
+++ b/test/RequestSignerTest.php
@@ -36,7 +36,7 @@ class RequestSignerTest extends TestCase
/**
* {@inheritDoc}
*/
- protected function setUp()
+ protected function setUp(): void
{
$authId = 'efdde334-fe7b-11e4-a322-1697f925ec7b';
$authSecret = 'W5PeGMxSItNerkNFqQMfYiJvH14WzVJMy54CPoTAYoI=';
@@ -74,11 +74,11 @@ public function testSignRequest()
$this->assertTrue($signedRequest->hasHeader('X-Authorization-Timestamp'));
$this->assertEquals($this->timestamp, $signedRequest->getHeaderLine('X-Authorization-Timestamp'));
$this->assertTrue($signedRequest->hasHeader('Authorization'));
- $this->assertContains('signature="MRlPr/Z1WQY2sMthcaEqETRMw4gPYXlPcTpaLWS2gcc="', $signedRequest->getHeaderLine('Authorization'));
+ $this->assertStringContainsString('signature="MRlPr/Z1WQY2sMthcaEqETRMw4gPYXlPcTpaLWS2gcc="', $signedRequest->getHeaderLine('Authorization'));
// Ensure that we can get the AuthorizationHeader back from the request.
$signedAuthRequest = $signer->getAuthorizedRequest($signedRequest);
- $this->assertContains('signature="MRlPr/Z1WQY2sMthcaEqETRMw4gPYXlPcTpaLWS2gcc="', $signedAuthRequest->getHeaderLine('Authorization'));
+ $this->assertStringContainsString('signature="MRlPr/Z1WQY2sMthcaEqETRMw4gPYXlPcTpaLWS2gcc="', $signedAuthRequest->getHeaderLine('Authorization'));
}
/**
diff --git a/test/ResponseAuthenticatorTest.php b/test/ResponseAuthenticatorTest.php
index a359922..e6b6888 100644
--- a/test/ResponseAuthenticatorTest.php
+++ b/test/ResponseAuthenticatorTest.php
@@ -26,7 +26,7 @@ class ResponseAuthenticatorTest extends TestCase
/**
* {@inheritDoc}
*/
- protected function setUp()
+ protected function setUp(): void
{
$authId = 'efdde334-fe7b-11e4-a322-1697f925ec7b';
$authSecret = 'W5PeGMxSItNerkNFqQMfYiJvH14WzVJMy54CPoTAYoI=';
@@ -71,9 +71,6 @@ public function testIsAuthentic()
/**
* Ensures an exception is thrown if response is missing a X-Server-Authorization-HMAC-SHA256 header.
- *
- * @expectedException \Acquia\Hmac\Exception\MalformedResponseException
- * @expectedExceptionMessage Response is missing required X-Server-Authorization-HMAC-SHA256 header.
*/
public function testMissingServerAuthorizationHeader()
{
@@ -82,6 +79,9 @@ public function testMissingServerAuthorizationHeader()
$authenticator = new ResponseAuthenticator($request, $this->authKey);
+ $this->expectException(MalformedResponseException::class);
+ $this->expectExceptionMessage('Response is missing required X-Server-Authorization-HMAC-SHA256 header.');
+
try {
$authenticator->isAuthentic($response);
} catch (MalformedResponseException $e) {
diff --git a/test/Symfony/HmacAuthenticationEntryPointTest.php b/test/Symfony/HmacAuthenticationEntryPointTest.php
index 774c6a4..713fb5d 100644
--- a/test/Symfony/HmacAuthenticationEntryPointTest.php
+++ b/test/Symfony/HmacAuthenticationEntryPointTest.php
@@ -27,6 +27,6 @@ public function testStart()
$response = $entryPoint->start($request, $authException);
$this->assertEquals(401, $response->getStatusCode());
- $this->assertContains($responseMessage, (string) $response);
+ $this->assertStringContainsString($responseMessage, (string) $response);
}
}
diff --git a/test/Symfony/HmacAuthenticationListenerTest.php b/test/Symfony/HmacAuthenticationListenerTest.php
index d483078..dd58afa 100644
--- a/test/Symfony/HmacAuthenticationListenerTest.php
+++ b/test/Symfony/HmacAuthenticationListenerTest.php
@@ -8,7 +8,7 @@
use Acquia\Hmac\Symfony\HmacToken;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
-use Symfony\Component\HttpKernel\Event\GetResponseEvent;
+use Symfony\Component\HttpKernel\Event\RequestEvent;
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
@@ -37,10 +37,10 @@ public function testRequiredAuthorizationHeader()
->will($this->returnValue($entryResponse));
$request = new Request();
- $event = new GetResponseEvent($kernel, $request, HttpKernelInterface::MASTER_REQUEST);
+ $event = new RequestEvent($kernel, $request, HttpKernelInterface::MASTER_REQUEST);
$listener = new HmacAuthenticationListener($storage, $manager, $entry);
- $listener->handle($event);
+ $listener($event);
$this->assertTrue($event->hasResponse());
$this->assertEquals($entryResponse->getStatusCode(), $event->getResponse()->getStatusCode());
@@ -71,11 +71,11 @@ public function testAuthentication()
->method('authenticate')
->will($this->returnValue($authToken));
- $event = new GetResponseEvent($kernel, $request, HttpKernelInterface::MASTER_REQUEST);
+ $event = new RequestEvent($kernel, $request, HttpKernelInterface::MASTER_REQUEST);
$listener = new HmacAuthenticationListener($storage, $manager, $entry);
$event->setResponse($response);
- $listener->handle($event);
+ $listener($event);
$handledRequest = $event->getRequest();
@@ -111,10 +111,10 @@ public function testFailedAuthentication()
->method('start')
->will($this->returnValue($entryResponse));
- $event = new GetResponseEvent($kernel, $request, HttpKernelInterface::MASTER_REQUEST);
+ $event = new RequestEvent($kernel, $request, HttpKernelInterface::MASTER_REQUEST);
$listener = new HmacAuthenticationListener($storage, $manager, $entry);
- $listener->handle($event);
+ $listener($event);
$this->assertTrue($event->hasResponse());
$this->assertEquals($entryResponse->getStatusCode(), $event->getResponse()->getStatusCode());
diff --git a/test/Symfony/HmacAuthenticationProviderTest.php b/test/Symfony/HmacAuthenticationProviderTest.php
index ddcd84c..cd55647 100644
--- a/test/Symfony/HmacAuthenticationProviderTest.php
+++ b/test/Symfony/HmacAuthenticationProviderTest.php
@@ -10,6 +10,7 @@
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Security\Core\Authentication\Token\AnonymousToken;
use PHPUnit\Framework\TestCase;
+use Symfony\Component\Security\Core\Exception\AuthenticationException;
/**
* Tests the Symfony authentication provider.
@@ -47,9 +48,6 @@ public function testAuthentication()
/**
* Ensures the authentication provider throws an exception if auth fails.
- *
- * @expectedException \Symfony\Component\Security\Core\Exception\AuthenticationException
- * @expectedExceptionMessage Authentication failed.
*/
public function testAuthenticationFailed()
{
@@ -59,6 +57,9 @@ public function testAuthenticationFailed()
->method('authenticate')
->will($this->throwException(new \Exception('Authentication failed.')));
+ $this->expectException(AuthenticationException::class);
+ $this->expectExceptionMessage('Authentication failed.');
+
$request = Request::create('http://example.com');
$token = new HmacToken($request);
$provider = new HmacAuthenticationProvider($authenticator);
diff --git a/test/Symfony/HmacResponseListenerTest.php b/test/Symfony/HmacResponseListenerTest.php
index f5ab6fa..d325c8e 100644
--- a/test/Symfony/HmacResponseListenerTest.php
+++ b/test/Symfony/HmacResponseListenerTest.php
@@ -6,7 +6,7 @@
use Acquia\Hmac\Symfony\HmacResponseListener;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
-use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
+use Symfony\Component\HttpKernel\Event\ResponseEvent;
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpKernel\KernelEvents;
use PHPUnit\Framework\TestCase;
@@ -33,7 +33,7 @@ public function testSubRequestsAreIgnored()
$request = $this->createMock(Request::class);
$response = $this->createMock(Response::class);
- $event = new FilterResponseEvent($kernel, $request, HttpKernelInterface::SUB_REQUEST, $response);
+ $event = new ResponseEvent($kernel, $request, HttpKernelInterface::SUB_REQUEST, $response);
$listener = new HmacResponseListener();
$listener->onKernelResponse($event);
@@ -50,7 +50,7 @@ public function testNonHmacRequestsAreIgnored()
$response = $this->createMock(Response::class);
$request = new Request();
- $event = new FilterResponseEvent($kernel, $request, HttpKernelInterface::MASTER_REQUEST, $response);
+ $event = new ResponseEvent($kernel, $request, HttpKernelInterface::MASTER_REQUEST, $response);
$listener = new HmacResponseListener();
$listener->onKernelResponse($event);
@@ -77,7 +77,7 @@ public function testHmacResponsesAreSigned()
$request->attributes->set('hmac.key', new Key($authId, $authSecret));
$response = new Response();
- $event = new FilterResponseEvent($kernel, $request, HttpKernelInterface::MASTER_REQUEST, $response);
+ $event = new ResponseEvent($kernel, $request, HttpKernelInterface::MASTER_REQUEST, $response);
$listener = new HmacResponseListener();
$listener->onKernelResponse($event);
From ce64234141a7800df14fc1cdac2983912c8d1227 Mon Sep 17 00:00:00 2001
From: Mark Trapp
Date: Sun, 27 Sep 2020 14:29:26 -0700
Subject: [PATCH 02/18] Fix matrix
---
.travis.yml | 135 +++++++++++++++++++++++++++++++++++++++++++---------
1 file changed, 112 insertions(+), 23 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 7619d9e..4844188 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -12,29 +12,118 @@ php:
- 7.2
env:
- - DIACTOROS_VERSION=2.4
- - DIACTOROS_VERSION=2.3
- - DIACTOROS_VERSION=2.2
- - DIACTOROS_VERSION=2.1
- - DIACTOROS_VERSION=2.0
- - DIACTOROS_VERSION=1.9
- - DIACTOROS_VERSION=1.8
- - PSR_MESSAGE_BRIDGE_VERSION=2.0
- - PSR_MESSAGE_BRIDGE_VERSION=1.2
- - PSR_MESSAGE_BRIDGE_VERSION=1.1
- - SYMFONY_VERSION=5.1
- - SYMFONY_VERSION=5.0
- - SYMFONY_VERSION=4.0
- - SYMFONY_VERSION=4.4
- - SYMFONY_VERSION=4.3
- - SYMFONY_VERSION=4.2
- - SYMFONY_VERSION=4.1
- - SYMFONY_VERSION=4.0
- - SYMFONY_VERSION=3.4
- - SYMFONY_VERSION=3.3
- - SYMFONY_VERSION=3.2
- - SYMFONY_VERSION=3.1
- - SYMFONY_VERSION=3.0
+ - DIACTOROS_VERSION=2.4 PSR_MESSAGE_BRIDGE_VERSION=2.0 SYMFONY_VERSION=5.1
+ - DIACTOROS_VERSION=2.4 PSR_MESSAGE_BRIDGE_VERSION=2.0 SYMFONY_VERSION=5.0
+ - DIACTOROS_VERSION=2.4 PSR_MESSAGE_BRIDGE_VERSION=2.0 SYMFONY_VERSION=4.4
+ - DIACTOROS_VERSION=2.4 PSR_MESSAGE_BRIDGE_VERSION=1.3 SYMFONY_VERSION=5.1
+ - DIACTOROS_VERSION=2.4 PSR_MESSAGE_BRIDGE_VERSION=1.3 SYMFONY_VERSION=5.0
+ - DIACTOROS_VERSION=2.4 PSR_MESSAGE_BRIDGE_VERSION=1.3 SYMFONY_VERSION=4.4
+ - DIACTOROS_VERSION=2.4 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=5.1
+ - DIACTOROS_VERSION=2.4 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=5.0
+ - DIACTOROS_VERSION=2.4 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=4.4
+ - DIACTOROS_VERSION=2.4 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=4.3
+ - DIACTOROS_VERSION=2.4 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=4.2
+ - DIACTOROS_VERSION=2.4 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=4.1
+ - DIACTOROS_VERSION=2.4 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=4.0
+ - DIACTOROS_VERSION=2.4 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=3.4
+ - DIACTOROS_VERSION=2.4 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=4.4
+ - DIACTOROS_VERSION=2.4 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=4.3
+ - DIACTOROS_VERSION=2.4 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=4.2
+ - DIACTOROS_VERSION=2.4 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=4.1
+ - DIACTOROS_VERSION=2.4 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=4.0
+ - DIACTOROS_VERSION=2.4 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=3.4
+ - DIACTOROS_VERSION=2.3 PSR_MESSAGE_BRIDGE_VERSION=2.0 SYMFONY_VERSION=5.1
+ - DIACTOROS_VERSION=2.3 PSR_MESSAGE_BRIDGE_VERSION=2.0 SYMFONY_VERSION=5.0
+ - DIACTOROS_VERSION=2.3 PSR_MESSAGE_BRIDGE_VERSION=2.0 SYMFONY_VERSION=4.4
+ - DIACTOROS_VERSION=2.3 PSR_MESSAGE_BRIDGE_VERSION=1.3 SYMFONY_VERSION=5.1
+ - DIACTOROS_VERSION=2.3 PSR_MESSAGE_BRIDGE_VERSION=1.3 SYMFONY_VERSION=5.0
+ - DIACTOROS_VERSION=2.3 PSR_MESSAGE_BRIDGE_VERSION=1.3 SYMFONY_VERSION=4.4
+ - DIACTOROS_VERSION=2.3 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=5.1
+ - DIACTOROS_VERSION=2.3 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=5.0
+ - DIACTOROS_VERSION=2.3 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=4.4
+ - DIACTOROS_VERSION=2.3 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=4.3
+ - DIACTOROS_VERSION=2.3 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=4.2
+ - DIACTOROS_VERSION=2.3 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=4.1
+ - DIACTOROS_VERSION=2.3 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=4.0
+ - DIACTOROS_VERSION=2.3 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=3.4
+ - DIACTOROS_VERSION=2.3 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=4.4
+ - DIACTOROS_VERSION=2.3 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=4.3
+ - DIACTOROS_VERSION=2.3 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=4.2
+ - DIACTOROS_VERSION=2.3 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=4.1
+ - DIACTOROS_VERSION=2.3 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=4.0
+ - DIACTOROS_VERSION=2.3 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=3.4
+ - DIACTOROS_VERSION=2.2 PSR_MESSAGE_BRIDGE_VERSION=2.0 SYMFONY_VERSION=5.1
+ - DIACTOROS_VERSION=2.2 PSR_MESSAGE_BRIDGE_VERSION=2.0 SYMFONY_VERSION=5.0
+ - DIACTOROS_VERSION=2.2 PSR_MESSAGE_BRIDGE_VERSION=2.0 SYMFONY_VERSION=4.4
+ - DIACTOROS_VERSION=2.2 PSR_MESSAGE_BRIDGE_VERSION=1.3 SYMFONY_VERSION=5.1
+ - DIACTOROS_VERSION=2.2 PSR_MESSAGE_BRIDGE_VERSION=1.3 SYMFONY_VERSION=5.0
+ - DIACTOROS_VERSION=2.2 PSR_MESSAGE_BRIDGE_VERSION=1.3 SYMFONY_VERSION=4.4
+ - DIACTOROS_VERSION=2.2 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=5.1
+ - DIACTOROS_VERSION=2.2 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=5.0
+ - DIACTOROS_VERSION=2.2 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=4.4
+ - DIACTOROS_VERSION=2.2 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=4.3
+ - DIACTOROS_VERSION=2.2 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=4.2
+ - DIACTOROS_VERSION=2.2 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=4.1
+ - DIACTOROS_VERSION=2.2 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=4.0
+ - DIACTOROS_VERSION=2.2 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=3.4
+ - DIACTOROS_VERSION=2.2 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=4.4
+ - DIACTOROS_VERSION=2.2 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=4.3
+ - DIACTOROS_VERSION=2.2 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=4.2
+ - DIACTOROS_VERSION=2.2 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=4.1
+ - DIACTOROS_VERSION=2.2 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=4.0
+ - DIACTOROS_VERSION=2.2 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=3.4
+ - DIACTOROS_VERSION=2.2 PSR_MESSAGE_BRIDGE_VERSION=2.0 SYMFONY_VERSION=5.1
+ - DIACTOROS_VERSION=2.2 PSR_MESSAGE_BRIDGE_VERSION=2.0 SYMFONY_VERSION=5.0
+ - DIACTOROS_VERSION=2.1 PSR_MESSAGE_BRIDGE_VERSION=2.0 SYMFONY_VERSION=4.4
+ - DIACTOROS_VERSION=2.1 PSR_MESSAGE_BRIDGE_VERSION=1.3 SYMFONY_VERSION=5.1
+ - DIACTOROS_VERSION=2.1 PSR_MESSAGE_BRIDGE_VERSION=1.3 SYMFONY_VERSION=5.0
+ - DIACTOROS_VERSION=2.1 PSR_MESSAGE_BRIDGE_VERSION=1.3 SYMFONY_VERSION=4.4
+ - DIACTOROS_VERSION=2.1 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=5.1
+ - DIACTOROS_VERSION=2.1 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=5.0
+ - DIACTOROS_VERSION=2.1 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=4.4
+ - DIACTOROS_VERSION=2.1 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=4.3
+ - DIACTOROS_VERSION=2.1 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=4.2
+ - DIACTOROS_VERSION=2.1 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=4.1
+ - DIACTOROS_VERSION=2.1 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=4.0
+ - DIACTOROS_VERSION=2.1 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=3.4
+ - DIACTOROS_VERSION=2.1 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=4.4
+ - DIACTOROS_VERSION=2.1 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=4.3
+ - DIACTOROS_VERSION=2.1 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=4.2
+ - DIACTOROS_VERSION=2.1 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=4.1
+ - DIACTOROS_VERSION=2.1 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=4.0
+ - DIACTOROS_VERSION=2.1 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=3.4
+ - DIACTOROS_VERSION=2.1 PSR_MESSAGE_BRIDGE_VERSION=2.0 SYMFONY_VERSION=4.4
+ - DIACTOROS_VERSION=2.1 PSR_MESSAGE_BRIDGE_VERSION=1.3 SYMFONY_VERSION=5.1
+ - DIACTOROS_VERSION=2.1 PSR_MESSAGE_BRIDGE_VERSION=1.3 SYMFONY_VERSION=5.0
+ - DIACTOROS_VERSION=2.1 PSR_MESSAGE_BRIDGE_VERSION=1.3 SYMFONY_VERSION=4.4
+ - DIACTOROS_VERSION=2.0 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=5.1
+ - DIACTOROS_VERSION=2.0 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=5.0
+ - DIACTOROS_VERSION=2.0 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=4.4
+ - DIACTOROS_VERSION=2.0 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=4.3
+ - DIACTOROS_VERSION=2.0 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=4.2
+ - DIACTOROS_VERSION=2.0 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=4.1
+ - DIACTOROS_VERSION=2.0 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=4.0
+ - DIACTOROS_VERSION=2.0 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=3.4
+ - DIACTOROS_VERSION=2.0 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=4.4
+ - DIACTOROS_VERSION=2.0 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=4.3
+ - DIACTOROS_VERSION=2.0 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=4.2
+ - DIACTOROS_VERSION=2.0 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=4.1
+ - DIACTOROS_VERSION=2.0 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=4.0
+ - DIACTOROS_VERSION=2.0 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=3.4
+ - DIACTOROS_VERSION=1.8 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=5.1
+ - DIACTOROS_VERSION=1.8 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=5.0
+ - DIACTOROS_VERSION=1.8 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=4.4
+ - DIACTOROS_VERSION=1.8 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=4.3
+ - DIACTOROS_VERSION=1.8 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=4.2
+ - DIACTOROS_VERSION=1.8 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=4.1
+ - DIACTOROS_VERSION=1.8 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=4.0
+ - DIACTOROS_VERSION=1.8 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=3.4
+ - DIACTOROS_VERSION=1.8 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=4.4
+ - DIACTOROS_VERSION=1.8 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=4.3
+ - DIACTOROS_VERSION=1.8 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=4.2
+ - DIACTOROS_VERSION=1.8 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=4.1
+ - DIACTOROS_VERSION=1.8 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=4.0
+ - DIACTOROS_VERSION=1.8 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=3.4
before_install:
- travis_retry composer self-update
From 0f427aa43f057afbb033198937214224597fc61f Mon Sep 17 00:00:00 2001
From: Mark Trapp
Date: Sun, 27 Sep 2020 14:36:21 -0700
Subject: [PATCH 03/18] Remove older minor versions from each major Symfony
line
---
.travis.yml | 63 -----------------------------------------------------
1 file changed, 63 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 4844188..406eb2e 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -13,116 +13,53 @@ php:
env:
- DIACTOROS_VERSION=2.4 PSR_MESSAGE_BRIDGE_VERSION=2.0 SYMFONY_VERSION=5.1
- - DIACTOROS_VERSION=2.4 PSR_MESSAGE_BRIDGE_VERSION=2.0 SYMFONY_VERSION=5.0
- DIACTOROS_VERSION=2.4 PSR_MESSAGE_BRIDGE_VERSION=2.0 SYMFONY_VERSION=4.4
- DIACTOROS_VERSION=2.4 PSR_MESSAGE_BRIDGE_VERSION=1.3 SYMFONY_VERSION=5.1
- - DIACTOROS_VERSION=2.4 PSR_MESSAGE_BRIDGE_VERSION=1.3 SYMFONY_VERSION=5.0
- DIACTOROS_VERSION=2.4 PSR_MESSAGE_BRIDGE_VERSION=1.3 SYMFONY_VERSION=4.4
- DIACTOROS_VERSION=2.4 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=5.1
- - DIACTOROS_VERSION=2.4 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=5.0
- DIACTOROS_VERSION=2.4 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=4.4
- - DIACTOROS_VERSION=2.4 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=4.3
- - DIACTOROS_VERSION=2.4 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=4.2
- - DIACTOROS_VERSION=2.4 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=4.1
- - DIACTOROS_VERSION=2.4 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=4.0
- DIACTOROS_VERSION=2.4 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=3.4
- DIACTOROS_VERSION=2.4 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=4.4
- - DIACTOROS_VERSION=2.4 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=4.3
- - DIACTOROS_VERSION=2.4 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=4.2
- - DIACTOROS_VERSION=2.4 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=4.1
- - DIACTOROS_VERSION=2.4 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=4.0
- DIACTOROS_VERSION=2.4 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=3.4
- DIACTOROS_VERSION=2.3 PSR_MESSAGE_BRIDGE_VERSION=2.0 SYMFONY_VERSION=5.1
- - DIACTOROS_VERSION=2.3 PSR_MESSAGE_BRIDGE_VERSION=2.0 SYMFONY_VERSION=5.0
- DIACTOROS_VERSION=2.3 PSR_MESSAGE_BRIDGE_VERSION=2.0 SYMFONY_VERSION=4.4
- DIACTOROS_VERSION=2.3 PSR_MESSAGE_BRIDGE_VERSION=1.3 SYMFONY_VERSION=5.1
- - DIACTOROS_VERSION=2.3 PSR_MESSAGE_BRIDGE_VERSION=1.3 SYMFONY_VERSION=5.0
- DIACTOROS_VERSION=2.3 PSR_MESSAGE_BRIDGE_VERSION=1.3 SYMFONY_VERSION=4.4
- DIACTOROS_VERSION=2.3 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=5.1
- - DIACTOROS_VERSION=2.3 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=5.0
- DIACTOROS_VERSION=2.3 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=4.4
- - DIACTOROS_VERSION=2.3 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=4.3
- - DIACTOROS_VERSION=2.3 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=4.2
- - DIACTOROS_VERSION=2.3 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=4.1
- - DIACTOROS_VERSION=2.3 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=4.0
- DIACTOROS_VERSION=2.3 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=3.4
- DIACTOROS_VERSION=2.3 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=4.4
- - DIACTOROS_VERSION=2.3 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=4.3
- - DIACTOROS_VERSION=2.3 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=4.2
- - DIACTOROS_VERSION=2.3 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=4.1
- - DIACTOROS_VERSION=2.3 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=4.0
- DIACTOROS_VERSION=2.3 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=3.4
- DIACTOROS_VERSION=2.2 PSR_MESSAGE_BRIDGE_VERSION=2.0 SYMFONY_VERSION=5.1
- - DIACTOROS_VERSION=2.2 PSR_MESSAGE_BRIDGE_VERSION=2.0 SYMFONY_VERSION=5.0
- DIACTOROS_VERSION=2.2 PSR_MESSAGE_BRIDGE_VERSION=2.0 SYMFONY_VERSION=4.4
- DIACTOROS_VERSION=2.2 PSR_MESSAGE_BRIDGE_VERSION=1.3 SYMFONY_VERSION=5.1
- - DIACTOROS_VERSION=2.2 PSR_MESSAGE_BRIDGE_VERSION=1.3 SYMFONY_VERSION=5.0
- DIACTOROS_VERSION=2.2 PSR_MESSAGE_BRIDGE_VERSION=1.3 SYMFONY_VERSION=4.4
- DIACTOROS_VERSION=2.2 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=5.1
- - DIACTOROS_VERSION=2.2 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=5.0
- DIACTOROS_VERSION=2.2 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=4.4
- - DIACTOROS_VERSION=2.2 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=4.3
- - DIACTOROS_VERSION=2.2 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=4.2
- - DIACTOROS_VERSION=2.2 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=4.1
- - DIACTOROS_VERSION=2.2 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=4.0
- DIACTOROS_VERSION=2.2 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=3.4
- DIACTOROS_VERSION=2.2 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=4.4
- - DIACTOROS_VERSION=2.2 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=4.3
- - DIACTOROS_VERSION=2.2 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=4.2
- - DIACTOROS_VERSION=2.2 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=4.1
- - DIACTOROS_VERSION=2.2 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=4.0
- DIACTOROS_VERSION=2.2 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=3.4
- DIACTOROS_VERSION=2.2 PSR_MESSAGE_BRIDGE_VERSION=2.0 SYMFONY_VERSION=5.1
- - DIACTOROS_VERSION=2.2 PSR_MESSAGE_BRIDGE_VERSION=2.0 SYMFONY_VERSION=5.0
- DIACTOROS_VERSION=2.1 PSR_MESSAGE_BRIDGE_VERSION=2.0 SYMFONY_VERSION=4.4
- DIACTOROS_VERSION=2.1 PSR_MESSAGE_BRIDGE_VERSION=1.3 SYMFONY_VERSION=5.1
- - DIACTOROS_VERSION=2.1 PSR_MESSAGE_BRIDGE_VERSION=1.3 SYMFONY_VERSION=5.0
- DIACTOROS_VERSION=2.1 PSR_MESSAGE_BRIDGE_VERSION=1.3 SYMFONY_VERSION=4.4
- DIACTOROS_VERSION=2.1 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=5.1
- - DIACTOROS_VERSION=2.1 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=5.0
- DIACTOROS_VERSION=2.1 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=4.4
- - DIACTOROS_VERSION=2.1 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=4.3
- - DIACTOROS_VERSION=2.1 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=4.2
- - DIACTOROS_VERSION=2.1 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=4.1
- - DIACTOROS_VERSION=2.1 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=4.0
- DIACTOROS_VERSION=2.1 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=3.4
- DIACTOROS_VERSION=2.1 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=4.4
- - DIACTOROS_VERSION=2.1 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=4.3
- - DIACTOROS_VERSION=2.1 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=4.2
- - DIACTOROS_VERSION=2.1 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=4.1
- - DIACTOROS_VERSION=2.1 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=4.0
- DIACTOROS_VERSION=2.1 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=3.4
- DIACTOROS_VERSION=2.1 PSR_MESSAGE_BRIDGE_VERSION=2.0 SYMFONY_VERSION=4.4
- DIACTOROS_VERSION=2.1 PSR_MESSAGE_BRIDGE_VERSION=1.3 SYMFONY_VERSION=5.1
- - DIACTOROS_VERSION=2.1 PSR_MESSAGE_BRIDGE_VERSION=1.3 SYMFONY_VERSION=5.0
- DIACTOROS_VERSION=2.1 PSR_MESSAGE_BRIDGE_VERSION=1.3 SYMFONY_VERSION=4.4
- DIACTOROS_VERSION=2.0 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=5.1
- - DIACTOROS_VERSION=2.0 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=5.0
- DIACTOROS_VERSION=2.0 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=4.4
- - DIACTOROS_VERSION=2.0 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=4.3
- - DIACTOROS_VERSION=2.0 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=4.2
- - DIACTOROS_VERSION=2.0 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=4.1
- - DIACTOROS_VERSION=2.0 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=4.0
- DIACTOROS_VERSION=2.0 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=3.4
- DIACTOROS_VERSION=2.0 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=4.4
- - DIACTOROS_VERSION=2.0 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=4.3
- - DIACTOROS_VERSION=2.0 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=4.2
- - DIACTOROS_VERSION=2.0 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=4.1
- - DIACTOROS_VERSION=2.0 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=4.0
- DIACTOROS_VERSION=2.0 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=3.4
- DIACTOROS_VERSION=1.8 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=5.1
- - DIACTOROS_VERSION=1.8 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=5.0
- DIACTOROS_VERSION=1.8 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=4.4
- - DIACTOROS_VERSION=1.8 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=4.3
- - DIACTOROS_VERSION=1.8 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=4.2
- - DIACTOROS_VERSION=1.8 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=4.1
- - DIACTOROS_VERSION=1.8 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=4.0
- DIACTOROS_VERSION=1.8 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=3.4
- DIACTOROS_VERSION=1.8 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=4.4
- - DIACTOROS_VERSION=1.8 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=4.3
- - DIACTOROS_VERSION=1.8 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=4.2
- - DIACTOROS_VERSION=1.8 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=4.1
- - DIACTOROS_VERSION=1.8 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=4.0
- DIACTOROS_VERSION=1.8 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=3.4
before_install:
From 7761798c67fc677d416eb09f7928ea6b6989f4bd Mon Sep 17 00:00:00 2001
From: Mark Trapp
Date: Sun, 27 Sep 2020 14:58:02 -0700
Subject: [PATCH 04/18] Replace DiactorosFactory with PsrHttpFactory
---
Makefile | 1 -
composer.json | 6 ++----
src/Symfony/HmacAuthenticationProvider.php | 8 +-------
src/Symfony/HmacResponseListener.php | 8 +-------
test/Mocks/Symfony/HmacClient.php | 8 ++++++--
5 files changed, 10 insertions(+), 21 deletions(-)
diff --git a/Makefile b/Makefile
index b8a8e9e..74923a1 100644
--- a/Makefile
+++ b/Makefile
@@ -9,7 +9,6 @@ clean:
test: install format
./vendor/bin/phpunit
./vendor/bin/phpmd src/,test/ text ./phpmd.xml
- ./vendor/bin/phpcpd src/ test/
./vendor/bin/phploc src/
coverage: install
diff --git a/composer.json b/composer.json
index 4420766..2e4cc6c 100644
--- a/composer.json
+++ b/composer.json
@@ -15,12 +15,12 @@
},
"require": {
"php": "^7.2",
- "psr/http-message": "^1.0"
+ "psr/http-message": "^1.0",
+ "symfony/psr-http-message-bridge": "~1.1.2"
},
"suggest": {
"guzzlehttp/guzzle": "^6.0",
"laminas/laminas-diactoros": "^1.8 || ^2.2",
- "symfony/psr-http-message-bridge": "^1.1.2 || ^2.0",
"symfony/security": "^3.0 || ^4.0 || ^5.0"
},
"require-dev": {
@@ -31,9 +31,7 @@
"phploc/phploc": "^5.0",
"phpmd/phpmd": "^2.0",
"phpunit/phpunit": "^8.0",
- "sebastian/phpcpd": "^4.0",
"symfony/phpunit-bridge": "^3.0 || ^4.0 || ^5.0",
- "symfony/psr-http-message-bridge": "^1.1.2 || ^2.0",
"symfony/security-bundle": "^3.0 || ^4.0 || ^5.0"
},
"replace": {
diff --git a/src/Symfony/HmacAuthenticationProvider.php b/src/Symfony/HmacAuthenticationProvider.php
index 7f207f9..b1e60bb 100644
--- a/src/Symfony/HmacAuthenticationProvider.php
+++ b/src/Symfony/HmacAuthenticationProvider.php
@@ -7,7 +7,6 @@
use Laminas\Diactoros\ServerRequestFactory;
use Laminas\Diactoros\StreamFactory;
use Laminas\Diactoros\UploadedFileFactory;
-use Symfony\Bridge\PsrHttpMessage\Factory\DiactorosFactory;
use Symfony\Bridge\PsrHttpMessage\Factory\PsrHttpFactory;
use Symfony\Component\Security\Core\Authentication\Provider\AuthenticationProviderInterface;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
@@ -40,12 +39,7 @@ public function __construct(RequestAuthenticatorInterface $authenticator)
*/
public function authenticate(TokenInterface $token)
{
- if (class_exists(DiactorosFactory::class)) {
- $httpMessageFactory = new DiactorosFactory();
- } else {
- $httpMessageFactory = new PsrHttpFactory(new ServerRequestFactory(), new StreamFactory(), new UploadedFileFactory(), new ResponseFactory());
- }
-
+ $httpMessageFactory = new PsrHttpFactory(new ServerRequestFactory(), new StreamFactory(), new UploadedFileFactory(), new ResponseFactory());
$psr7Request = $httpMessageFactory->createRequest($token->getRequest());
try {
diff --git a/src/Symfony/HmacResponseListener.php b/src/Symfony/HmacResponseListener.php
index 889f1da..d71d49d 100644
--- a/src/Symfony/HmacResponseListener.php
+++ b/src/Symfony/HmacResponseListener.php
@@ -7,7 +7,6 @@
use Laminas\Diactoros\ServerRequestFactory;
use Laminas\Diactoros\StreamFactory;
use Laminas\Diactoros\UploadedFileFactory;
-use Symfony\Bridge\PsrHttpMessage\Factory\DiactorosFactory;
use Symfony\Bridge\PsrHttpMessage\Factory\PsrHttpFactory;
use Symfony\Bridge\PsrHttpMessage\Factory\HttpFoundationFactory;
use Symfony\Component\HttpKernel\Event\ResponseEvent;
@@ -32,12 +31,7 @@ public function onKernelResponse(ResponseEvent $event)
$response = $event->getResponse();
if ($request->attributes->has('hmac.key')) {
- if (class_exists(DiactorosFactory::class)) {
- $httpMessageFactory = new DiactorosFactory();
- } else {
- $httpMessageFactory = new PsrHttpFactory(new ServerRequestFactory(), new StreamFactory(), new UploadedFileFactory(), new ResponseFactory());
- }
-
+ $httpMessageFactory = new PsrHttpFactory(new ServerRequestFactory(), new StreamFactory(), new UploadedFileFactory(), new ResponseFactory());
$foundationFactory = new HttpFoundationFactory();
$psr7Request = $httpMessageFactory->createRequest($request);
diff --git a/test/Mocks/Symfony/HmacClient.php b/test/Mocks/Symfony/HmacClient.php
index 3b28d9a..f914580 100644
--- a/test/Mocks/Symfony/HmacClient.php
+++ b/test/Mocks/Symfony/HmacClient.php
@@ -5,8 +5,12 @@
use Acquia\Hmac\KeyInterface;
use Acquia\Hmac\RequestSigner;
use Acquia\Hmac\ResponseAuthenticator;
+use Laminas\Diactoros\ResponseFactory;
+use Laminas\Diactoros\ServerRequestFactory;
+use Laminas\Diactoros\StreamFactory;
+use Laminas\Diactoros\UploadedFileFactory;
+use Symfony\Bridge\PsrHttpMessage\Factory\PsrHttpFactory;
use Symfony\Bundle\FrameworkBundle\Client;
-use Symfony\Bridge\PsrHttpMessage\Factory\DiactorosFactory;
use Symfony\Bridge\PsrHttpMessage\Factory\HttpFoundationFactory;
use Symfony\Component\HttpFoundation\Response;
@@ -51,7 +55,7 @@ protected function doRequest($request)
return new Response('The HTTP HMAC key has not been provided.', 400);
}
- $psr7Factory = new DiactorosFactory();
+ $psr7Factory = new PsrHttpFactory(new ServerRequestFactory(), new StreamFactory(), new UploadedFileFactory(), new ResponseFactory());
$httpFoundationFactory = new HttpFoundationFactory();
$psrRequest = $psr7Factory->createRequest($request);
From 6dd5762a2500c5732e44ba263222fccf7f99a71d Mon Sep 17 00:00:00 2001
From: Mark Trapp
Date: Sun, 27 Sep 2020 15:01:27 -0700
Subject: [PATCH 05/18] Remove phploc dependency
---
composer.json | 1 -
1 file changed, 1 deletion(-)
diff --git a/composer.json b/composer.json
index 2e4cc6c..2750109 100644
--- a/composer.json
+++ b/composer.json
@@ -28,7 +28,6 @@
"guzzlehttp/guzzle": "^6.0",
"laminas/laminas-diactoros": "^1.8 || ^2.2",
"php-coveralls/php-coveralls": "^2.2",
- "phploc/phploc": "^5.0",
"phpmd/phpmd": "^2.0",
"phpunit/phpunit": "^8.0",
"symfony/phpunit-bridge": "^3.0 || ^4.0 || ^5.0",
From 0c3d92061fedf509780b0fcf383c9e713e65ee9e Mon Sep 17 00:00:00 2001
From: Mark Trapp
Date: Sun, 27 Sep 2020 15:04:04 -0700
Subject: [PATCH 06/18] Remove phploc from Makefile
---
Makefile | 1 -
1 file changed, 1 deletion(-)
diff --git a/Makefile b/Makefile
index 74923a1..dae51dc 100644
--- a/Makefile
+++ b/Makefile
@@ -9,7 +9,6 @@ clean:
test: install format
./vendor/bin/phpunit
./vendor/bin/phpmd src/,test/ text ./phpmd.xml
- ./vendor/bin/phploc src/
coverage: install
phpdbg ./vendor/bin/phpunit --coverage-clover dist/tests.clover
From d3c2937c56a83bb593206a92c0204bf207ecafc8 Mon Sep 17 00:00:00 2001
From: Mark Trapp
Date: Sun, 27 Sep 2020 15:13:18 -0700
Subject: [PATCH 07/18] Fix constraints
---
composer.json | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/composer.json b/composer.json
index 2750109..1e7631a 100644
--- a/composer.json
+++ b/composer.json
@@ -15,8 +15,7 @@
},
"require": {
"php": "^7.2",
- "psr/http-message": "^1.0",
- "symfony/psr-http-message-bridge": "~1.1.2"
+ "psr/http-message": "^1.0"
},
"suggest": {
"guzzlehttp/guzzle": "^6.0",
@@ -31,6 +30,7 @@
"phpmd/phpmd": "^2.0",
"phpunit/phpunit": "^8.0",
"symfony/phpunit-bridge": "^3.0 || ^4.0 || ^5.0",
+ "symfony/psr-http-message-bridge": "^1.1.2 || ^2.0",
"symfony/security-bundle": "^3.0 || ^4.0 || ^5.0"
},
"replace": {
From e6f3961dd9dff2ae1e65cec39efe9803bb986674 Mon Sep 17 00:00:00 2001
From: Mark Trapp
Date: Sun, 27 Sep 2020 16:00:16 -0700
Subject: [PATCH 08/18] Replace Diactoros with Nyholm
---
composer.json | 3 +--
src/Symfony/HmacAuthenticationProvider.php | 8 +++-----
src/Symfony/HmacResponseListener.php | 8 +++-----
test/Mocks/Symfony/HmacClient.php | 8 +++-----
4 files changed, 10 insertions(+), 17 deletions(-)
diff --git a/composer.json b/composer.json
index 1e7631a..696eb82 100644
--- a/composer.json
+++ b/composer.json
@@ -25,12 +25,11 @@
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.16",
"guzzlehttp/guzzle": "^6.0",
- "laminas/laminas-diactoros": "^1.8 || ^2.2",
+ "nyholm/psr7": "^1.0",
"php-coveralls/php-coveralls": "^2.2",
"phpmd/phpmd": "^2.0",
"phpunit/phpunit": "^8.0",
"symfony/phpunit-bridge": "^3.0 || ^4.0 || ^5.0",
- "symfony/psr-http-message-bridge": "^1.1.2 || ^2.0",
"symfony/security-bundle": "^3.0 || ^4.0 || ^5.0"
},
"replace": {
diff --git a/src/Symfony/HmacAuthenticationProvider.php b/src/Symfony/HmacAuthenticationProvider.php
index b1e60bb..ac1611f 100644
--- a/src/Symfony/HmacAuthenticationProvider.php
+++ b/src/Symfony/HmacAuthenticationProvider.php
@@ -3,10 +3,7 @@
namespace Acquia\Hmac\Symfony;
use Acquia\Hmac\RequestAuthenticatorInterface;
-use Laminas\Diactoros\ResponseFactory;
-use Laminas\Diactoros\ServerRequestFactory;
-use Laminas\Diactoros\StreamFactory;
-use Laminas\Diactoros\UploadedFileFactory;
+use Nyholm\Psr7\Factory\Psr17Factory;
use Symfony\Bridge\PsrHttpMessage\Factory\PsrHttpFactory;
use Symfony\Component\Security\Core\Authentication\Provider\AuthenticationProviderInterface;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
@@ -39,7 +36,8 @@ public function __construct(RequestAuthenticatorInterface $authenticator)
*/
public function authenticate(TokenInterface $token)
{
- $httpMessageFactory = new PsrHttpFactory(new ServerRequestFactory(), new StreamFactory(), new UploadedFileFactory(), new ResponseFactory());
+ $psr17Factory = new Psr17Factory();
+ $httpMessageFactory = new PsrHttpFactory($psr17Factory, $psr17Factory, $psr17Factory, $psr17Factory);
$psr7Request = $httpMessageFactory->createRequest($token->getRequest());
try {
diff --git a/src/Symfony/HmacResponseListener.php b/src/Symfony/HmacResponseListener.php
index d71d49d..9dc3d30 100644
--- a/src/Symfony/HmacResponseListener.php
+++ b/src/Symfony/HmacResponseListener.php
@@ -3,10 +3,7 @@
namespace Acquia\Hmac\Symfony;
use Acquia\Hmac\ResponseSigner;
-use Laminas\Diactoros\ResponseFactory;
-use Laminas\Diactoros\ServerRequestFactory;
-use Laminas\Diactoros\StreamFactory;
-use Laminas\Diactoros\UploadedFileFactory;
+use Nyholm\Psr7\Factory\Psr17Factory;
use Symfony\Bridge\PsrHttpMessage\Factory\PsrHttpFactory;
use Symfony\Bridge\PsrHttpMessage\Factory\HttpFoundationFactory;
use Symfony\Component\HttpKernel\Event\ResponseEvent;
@@ -31,7 +28,8 @@ public function onKernelResponse(ResponseEvent $event)
$response = $event->getResponse();
if ($request->attributes->has('hmac.key')) {
- $httpMessageFactory = new PsrHttpFactory(new ServerRequestFactory(), new StreamFactory(), new UploadedFileFactory(), new ResponseFactory());
+ $psr17Factory = new Psr17Factory();
+ $httpMessageFactory = new PsrHttpFactory($psr17Factory, $psr17Factory, $psr17Factory, $psr17Factory);
$foundationFactory = new HttpFoundationFactory();
$psr7Request = $httpMessageFactory->createRequest($request);
diff --git a/test/Mocks/Symfony/HmacClient.php b/test/Mocks/Symfony/HmacClient.php
index f914580..0d399a6 100644
--- a/test/Mocks/Symfony/HmacClient.php
+++ b/test/Mocks/Symfony/HmacClient.php
@@ -5,10 +5,7 @@
use Acquia\Hmac\KeyInterface;
use Acquia\Hmac\RequestSigner;
use Acquia\Hmac\ResponseAuthenticator;
-use Laminas\Diactoros\ResponseFactory;
-use Laminas\Diactoros\ServerRequestFactory;
-use Laminas\Diactoros\StreamFactory;
-use Laminas\Diactoros\UploadedFileFactory;
+use Nyholm\Psr7\Factory\Psr17Factory;
use Symfony\Bridge\PsrHttpMessage\Factory\PsrHttpFactory;
use Symfony\Bundle\FrameworkBundle\Client;
use Symfony\Bridge\PsrHttpMessage\Factory\HttpFoundationFactory;
@@ -55,7 +52,8 @@ protected function doRequest($request)
return new Response('The HTTP HMAC key has not been provided.', 400);
}
- $psr7Factory = new PsrHttpFactory(new ServerRequestFactory(), new StreamFactory(), new UploadedFileFactory(), new ResponseFactory());
+ $psr17Factory = new Psr17Factory();
+ $psr7Factory = new PsrHttpFactory($psr17Factory, $psr17Factory, $psr17Factory, $psr17Factory);
$httpFoundationFactory = new HttpFoundationFactory();
$psrRequest = $psr7Factory->createRequest($request);
From 9531f0d5978c1c08f5fa2f1e24678b13ab1f8c6e Mon Sep 17 00:00:00 2001
From: Mark Trapp
Date: Sun, 27 Sep 2020 16:03:19 -0700
Subject: [PATCH 09/18] Remove Diactoros from the build matrix
---
.travis.yml | 59 ++++++++---------------------------------------------
1 file changed, 9 insertions(+), 50 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 406eb2e..8a94a13 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -12,55 +12,15 @@ php:
- 7.2
env:
- - DIACTOROS_VERSION=2.4 PSR_MESSAGE_BRIDGE_VERSION=2.0 SYMFONY_VERSION=5.1
- - DIACTOROS_VERSION=2.4 PSR_MESSAGE_BRIDGE_VERSION=2.0 SYMFONY_VERSION=4.4
- - DIACTOROS_VERSION=2.4 PSR_MESSAGE_BRIDGE_VERSION=1.3 SYMFONY_VERSION=5.1
- - DIACTOROS_VERSION=2.4 PSR_MESSAGE_BRIDGE_VERSION=1.3 SYMFONY_VERSION=4.4
- - DIACTOROS_VERSION=2.4 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=5.1
- - DIACTOROS_VERSION=2.4 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=4.4
- - DIACTOROS_VERSION=2.4 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=3.4
- - DIACTOROS_VERSION=2.4 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=4.4
- - DIACTOROS_VERSION=2.4 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=3.4
- - DIACTOROS_VERSION=2.3 PSR_MESSAGE_BRIDGE_VERSION=2.0 SYMFONY_VERSION=5.1
- - DIACTOROS_VERSION=2.3 PSR_MESSAGE_BRIDGE_VERSION=2.0 SYMFONY_VERSION=4.4
- - DIACTOROS_VERSION=2.3 PSR_MESSAGE_BRIDGE_VERSION=1.3 SYMFONY_VERSION=5.1
- - DIACTOROS_VERSION=2.3 PSR_MESSAGE_BRIDGE_VERSION=1.3 SYMFONY_VERSION=4.4
- - DIACTOROS_VERSION=2.3 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=5.1
- - DIACTOROS_VERSION=2.3 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=4.4
- - DIACTOROS_VERSION=2.3 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=3.4
- - DIACTOROS_VERSION=2.3 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=4.4
- - DIACTOROS_VERSION=2.3 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=3.4
- - DIACTOROS_VERSION=2.2 PSR_MESSAGE_BRIDGE_VERSION=2.0 SYMFONY_VERSION=5.1
- - DIACTOROS_VERSION=2.2 PSR_MESSAGE_BRIDGE_VERSION=2.0 SYMFONY_VERSION=4.4
- - DIACTOROS_VERSION=2.2 PSR_MESSAGE_BRIDGE_VERSION=1.3 SYMFONY_VERSION=5.1
- - DIACTOROS_VERSION=2.2 PSR_MESSAGE_BRIDGE_VERSION=1.3 SYMFONY_VERSION=4.4
- - DIACTOROS_VERSION=2.2 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=5.1
- - DIACTOROS_VERSION=2.2 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=4.4
- - DIACTOROS_VERSION=2.2 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=3.4
- - DIACTOROS_VERSION=2.2 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=4.4
- - DIACTOROS_VERSION=2.2 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=3.4
- - DIACTOROS_VERSION=2.2 PSR_MESSAGE_BRIDGE_VERSION=2.0 SYMFONY_VERSION=5.1
- - DIACTOROS_VERSION=2.1 PSR_MESSAGE_BRIDGE_VERSION=2.0 SYMFONY_VERSION=4.4
- - DIACTOROS_VERSION=2.1 PSR_MESSAGE_BRIDGE_VERSION=1.3 SYMFONY_VERSION=5.1
- - DIACTOROS_VERSION=2.1 PSR_MESSAGE_BRIDGE_VERSION=1.3 SYMFONY_VERSION=4.4
- - DIACTOROS_VERSION=2.1 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=5.1
- - DIACTOROS_VERSION=2.1 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=4.4
- - DIACTOROS_VERSION=2.1 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=3.4
- - DIACTOROS_VERSION=2.1 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=4.4
- - DIACTOROS_VERSION=2.1 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=3.4
- - DIACTOROS_VERSION=2.1 PSR_MESSAGE_BRIDGE_VERSION=2.0 SYMFONY_VERSION=4.4
- - DIACTOROS_VERSION=2.1 PSR_MESSAGE_BRIDGE_VERSION=1.3 SYMFONY_VERSION=5.1
- - DIACTOROS_VERSION=2.1 PSR_MESSAGE_BRIDGE_VERSION=1.3 SYMFONY_VERSION=4.4
- - DIACTOROS_VERSION=2.0 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=5.1
- - DIACTOROS_VERSION=2.0 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=4.4
- - DIACTOROS_VERSION=2.0 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=3.4
- - DIACTOROS_VERSION=2.0 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=4.4
- - DIACTOROS_VERSION=2.0 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=3.4
- - DIACTOROS_VERSION=1.8 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=5.1
- - DIACTOROS_VERSION=1.8 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=4.4
- - DIACTOROS_VERSION=1.8 PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=3.4
- - DIACTOROS_VERSION=1.8 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=4.4
- - DIACTOROS_VERSION=1.8 PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=3.4
+ - PSR_MESSAGE_BRIDGE_VERSION=2.0 SYMFONY_VERSION=5.1
+ - PSR_MESSAGE_BRIDGE_VERSION=2.0 SYMFONY_VERSION=4.4
+ - PSR_MESSAGE_BRIDGE_VERSION=1.3 SYMFONY_VERSION=5.1
+ - PSR_MESSAGE_BRIDGE_VERSION=1.3 SYMFONY_VERSION=4.4
+ - PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=5.1
+ - PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=4.4
+ - PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=3.4
+ - PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=4.4
+ - PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=3.4
before_install:
- travis_retry composer self-update
@@ -68,7 +28,6 @@ before_install:
- echo "memory_limit=2G" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
install:
- - composer require "laminas/laminas-diactoros:${DIACTOROS_VERSION}" --no-update
- composer require "symfony/psr-http-message-bridge:${PSR_MESSAGE_BRIDGE_VERSION}" --no-update
- composer require "symfony/security-bundle:${SYMFONY_VERSION}" --no-update
- travis_retry make install
From 45ebe6657ec2734028ec101fff42e51903ac3cae Mon Sep 17 00:00:00 2001
From: Mark Trapp
Date: Sun, 27 Sep 2020 16:09:26 -0700
Subject: [PATCH 10/18] Remove reference to Diactoros env variable
---
.travis.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.travis.yml b/.travis.yml
index 8a94a13..6efa02b 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -39,4 +39,4 @@ jobs:
include:
- stage: coverage
script: make coverage
- env: DIACTOROS_VERSION=2.4 PSR_MESSAGE_BRIDGE_VERSION=2.0 SYMFONY_VERSION=5.1
+ env: PSR_MESSAGE_BRIDGE_VERSION=2.0 SYMFONY_VERSION=5.1
From 071106bd5ef780a2208306742b2e58ef3bcc1e58 Mon Sep 17 00:00:00 2001
From: Mark Trapp
Date: Sun, 27 Sep 2020 16:18:28 -0700
Subject: [PATCH 11/18] Fix coverage command
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index dae51dc..a0c6535 100644
--- a/Makefile
+++ b/Makefile
@@ -11,7 +11,7 @@ test: install format
./vendor/bin/phpmd src/,test/ text ./phpmd.xml
coverage: install
- phpdbg ./vendor/bin/phpunit --coverage-clover dist/tests.clover
+ phpdbg -qrr ./vendor/bin/phpunit --coverage-clover dist/tests.clover
./vendor/bin/coveralls -v --coverage_clover='./dist/tests.clover'
update:
From 69160adaa6e26580d11f7855ea537b4d544420a4 Mon Sep 17 00:00:00 2001
From: Mark Trapp
Date: Sun, 27 Sep 2020 16:42:18 -0700
Subject: [PATCH 12/18] Fix PHP Coverage command
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index a0c6535..8d9f0b7 100644
--- a/Makefile
+++ b/Makefile
@@ -12,7 +12,7 @@ test: install format
coverage: install
phpdbg -qrr ./vendor/bin/phpunit --coverage-clover dist/tests.clover
- ./vendor/bin/coveralls -v --coverage_clover='./dist/tests.clover'
+ ./vendor/bin/php-coverage -v --coverage_clover='./dist/tests.clover'
update:
composer update --no-interaction
From dfa2651aae863dcc631f60e0573883fd4d2062cc Mon Sep 17 00:00:00 2001
From: Mark Trapp
Date: Sun, 27 Sep 2020 16:56:58 -0700
Subject: [PATCH 13/18] Fix PHP Coveralls command
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 8d9f0b7..433e862 100644
--- a/Makefile
+++ b/Makefile
@@ -12,7 +12,7 @@ test: install format
coverage: install
phpdbg -qrr ./vendor/bin/phpunit --coverage-clover dist/tests.clover
- ./vendor/bin/php-coverage -v --coverage_clover='./dist/tests.clover'
+ ./vendor/bin/php-coveralls -v --coverage_clover='./dist/tests.clover'
update:
composer update --no-interaction
From 3d6e02faa515f734831d0536de084e5feca15067 Mon Sep 17 00:00:00 2001
From: Mark Trapp
Date: Sun, 27 Sep 2020 17:18:08 -0700
Subject: [PATCH 14/18] Specify JSON path for Coveralls
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 433e862..f4887bf 100644
--- a/Makefile
+++ b/Makefile
@@ -12,7 +12,7 @@ test: install format
coverage: install
phpdbg -qrr ./vendor/bin/phpunit --coverage-clover dist/tests.clover
- ./vendor/bin/php-coveralls -v --coverage_clover='./dist/tests.clover'
+ ./vendor/bin/php-coveralls -v --coverage_clover='./dist/tests.clover' --json_path='./dist/'
update:
composer update --no-interaction
From 171fc73e915d123e133e081f24ed515dea1c96f5 Mon Sep 17 00:00:00 2001
From: Mark Trapp
Date: Sun, 27 Sep 2020 17:35:04 -0700
Subject: [PATCH 15/18] Text fixed json_path
---
.travis.yml | 16 ++++++++--------
Makefile | 2 +-
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 6efa02b..0893a6f 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -13,14 +13,14 @@ php:
env:
- PSR_MESSAGE_BRIDGE_VERSION=2.0 SYMFONY_VERSION=5.1
- - PSR_MESSAGE_BRIDGE_VERSION=2.0 SYMFONY_VERSION=4.4
- - PSR_MESSAGE_BRIDGE_VERSION=1.3 SYMFONY_VERSION=5.1
- - PSR_MESSAGE_BRIDGE_VERSION=1.3 SYMFONY_VERSION=4.4
- - PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=5.1
- - PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=4.4
- - PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=3.4
- - PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=4.4
- - PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=3.4
+# - PSR_MESSAGE_BRIDGE_VERSION=2.0 SYMFONY_VERSION=4.4
+# - PSR_MESSAGE_BRIDGE_VERSION=1.3 SYMFONY_VERSION=5.1
+# - PSR_MESSAGE_BRIDGE_VERSION=1.3 SYMFONY_VERSION=4.4
+# - PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=5.1
+# - PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=4.4
+# - PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=3.4
+# - PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=4.4
+# - PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=3.4
before_install:
- travis_retry composer self-update
diff --git a/Makefile b/Makefile
index f4887bf..510d8c4 100644
--- a/Makefile
+++ b/Makefile
@@ -12,7 +12,7 @@ test: install format
coverage: install
phpdbg -qrr ./vendor/bin/phpunit --coverage-clover dist/tests.clover
- ./vendor/bin/php-coveralls -v --coverage_clover='./dist/tests.clover' --json_path='./dist/'
+ ./vendor/bin/php-coveralls -v --coverage_clover='./dist/tests.clover' --json_path='./dist/coveralls-upload.json'
update:
composer update --no-interaction
From 7bc3cb4f6eb1b60c480c70091ce62bd87f5e1821 Mon Sep 17 00:00:00 2001
From: Mark Trapp
Date: Sun, 27 Sep 2020 17:40:03 -0700
Subject: [PATCH 16/18] Add back disabled jobs
---
.travis.yml | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 0893a6f..6efa02b 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -13,14 +13,14 @@ php:
env:
- PSR_MESSAGE_BRIDGE_VERSION=2.0 SYMFONY_VERSION=5.1
-# - PSR_MESSAGE_BRIDGE_VERSION=2.0 SYMFONY_VERSION=4.4
-# - PSR_MESSAGE_BRIDGE_VERSION=1.3 SYMFONY_VERSION=5.1
-# - PSR_MESSAGE_BRIDGE_VERSION=1.3 SYMFONY_VERSION=4.4
-# - PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=5.1
-# - PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=4.4
-# - PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=3.4
-# - PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=4.4
-# - PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=3.4
+ - PSR_MESSAGE_BRIDGE_VERSION=2.0 SYMFONY_VERSION=4.4
+ - PSR_MESSAGE_BRIDGE_VERSION=1.3 SYMFONY_VERSION=5.1
+ - PSR_MESSAGE_BRIDGE_VERSION=1.3 SYMFONY_VERSION=4.4
+ - PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=5.1
+ - PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=4.4
+ - PSR_MESSAGE_BRIDGE_VERSION=1.2 SYMFONY_VERSION=3.4
+ - PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=4.4
+ - PSR_MESSAGE_BRIDGE_VERSION=1.1.2 SYMFONY_VERSION=3.4
before_install:
- travis_retry composer self-update
From 119692c8baa084c4bacd55979a6cb3ccd197989f Mon Sep 17 00:00:00 2001
From: Mark Trapp
Date: Sun, 27 Sep 2020 17:40:13 -0700
Subject: [PATCH 17/18] Add back missing dev dependency
---
composer.json | 1 +
1 file changed, 1 insertion(+)
diff --git a/composer.json b/composer.json
index 696eb82..5735da8 100644
--- a/composer.json
+++ b/composer.json
@@ -29,6 +29,7 @@
"php-coveralls/php-coveralls": "^2.2",
"phpmd/phpmd": "^2.0",
"phpunit/phpunit": "^8.0",
+ "symfony/psr-http-message-bridge": "^1.1.2 || ^2.0",
"symfony/phpunit-bridge": "^3.0 || ^4.0 || ^5.0",
"symfony/security-bundle": "^3.0 || ^4.0 || ^5.0"
},
From baaa39243638a1bb16823b71b71bb1a00ff930d7 Mon Sep 17 00:00:00 2001
From: Mark Trapp
Date: Tue, 29 Sep 2020 06:36:52 -0700
Subject: [PATCH 18/18] Add back format testing
---
Makefile | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 510d8c4..cb2b328 100644
--- a/Makefile
+++ b/Makefile
@@ -6,8 +6,9 @@ install:
clean:
rm -rf vendor/ dist/ composer.lock .php_cs.cache .phpunit.result.cache
-test: install format
+test: install
./vendor/bin/phpunit
+ ./vendor/bin/php-cs-fixer fix --dry-run -v
./vendor/bin/phpmd src/,test/ text ./phpmd.xml
coverage: install