diff --git a/.travis.yml b/.travis.yml index 5129757..e5703f4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,18 +3,19 @@ language: php sudo: false php: - - 7.0 - 7.1 - 7.2 + - 7.3 + - 7.4 - nightly env: - - SYMFONY_VERSION=2.7.* # LTS - - SYMFONY_VERSION=2.8.* # LTS - - SYMFONY_VERSION=3.2.* - - SYMFONY_VERSION=3.3.* - - SYMFONY_VERSION=3.4.* # LTS - - SYMFONY_VERSION=4.0.* + - SYMFONY_VERSION=4.1.* # (until 07/2019) + - SYMFONY_VERSION=4.2.* # (until 01/2020) + - SYMFONY_VERSION=4.3.* # (until 07/2020) + - SYMFONY_VERSION=4.4.* # LTS (11/2019, until 11/2023) + - SYMFONY_VERSION=5.0.* # (until 07/2020) + - DEPENDENCIES=dev cache: directories: @@ -22,28 +23,26 @@ cache: before_install: - composer self-update - - if [ "$DEPENDENCIES" == "dev" ]; then perl -pi -e 's/^}$/,"minimum-stability":"dev"}/' composer.json; fi; + - if [ "$DEPENDENCIES" == "dev" ]; then composer config minimum-stability $DEPENDENCIES; fi; - if [ "$SYMFONY_VERSION" != "" ]; then composer --no-update require symfony/symfony:${SYMFONY_VERSION}; fi; install: - composer update script: - - mkdir -p build/logs - - php vendor/bin/phpunit --coverage-text + - composer validate --strict --no-check-lock + - vendor/bin/phpunit --coverage-text --verbose after_success: - - travis_retry php vendor/bin/coveralls + - travis_retry php vendor/bin/php-coveralls matrix: exclude: - - php: 7 - env: SYMFONY_VERSION=4.0.* # requires PHP ^7.1.3 - - php: 7 - env: SYMFONY_VERSION=dev-master # requires PHP ^7.1.3 + - php: 7.1 + env: SYMFONY_VERSION=5.0.* # requires PHP ^7.2.5 allow_failures: + - env: DEPENDENCIES=dev - php: nightly - - env: SYMFONY_VERSION=dev-master notifications: email: diff --git a/composer.json b/composer.json index 2787958..9b783c5 100644 --- a/composer.json +++ b/composer.json @@ -18,19 +18,19 @@ ], "require": { - "php": "^7.0", + "php": ">=7.1", "guzzlehttp/guzzle": "^6.0", - "eightpoints/guzzle-bundle": "~7.1", - "symfony/http-kernel": "~2.7|~3.0|~4.0|~5.0", - "symfony/config": "~2.7|~3.0|~4.0|~5.0", - "symfony/dependency-injection": "~2.7|~3.0|~4.0|~5.0", - "symfony/expression-language": "~2.7|~3.0|~4.0|~5.0", + "eightpoints/guzzle-bundle": "^8.0.1", + "symfony/http-kernel": "~4.0|~5.0", + "symfony/config": "~4.0|~5.0", + "symfony/dependency-injection": "~4.0|~5.0", + "symfony/expression-language": "~4.0|~5.0", "sainsburys/guzzle-oauth2-plugin": "^3.0.5" }, "require-dev": { - "phpunit/phpunit": "~6.1", - "satooshi/php-coveralls": "~1.0" + "phpunit/phpunit": "~7.5", + "php-coveralls/php-coveralls": "~2.2" }, "autoload": { diff --git a/src/GuzzleBundleOAuth2Plugin.php b/src/GuzzleBundleOAuth2Plugin.php index 6180f15..227c8a2 100644 --- a/src/GuzzleBundleOAuth2Plugin.php +++ b/src/GuzzleBundleOAuth2Plugin.php @@ -3,8 +3,8 @@ namespace Gregurco\Bundle\GuzzleBundleOAuth2Plugin; +use EightPoints\Bundle\GuzzleBundle\PluginInterface; use Gregurco\Bundle\GuzzleBundleOAuth2Plugin\DependencyInjection\GuzzleBundleOAuth2Extension; -use EightPoints\Bundle\GuzzleBundle\EightPointsGuzzleBundlePlugin; use Sainsburys\Guzzle\Oauth2\GrantType\ClientCredentials; use Sainsburys\Guzzle\Oauth2\GrantType\GrantTypeBase; use Sainsburys\Guzzle\Oauth2\GrantType\GrantTypeInterface; @@ -20,13 +20,13 @@ use Symfony\Component\ExpressionLanguage\Expression; use GuzzleHttp\Client; -class GuzzleBundleOAuth2Plugin extends Bundle implements EightPointsGuzzleBundlePlugin +class GuzzleBundleOAuth2Plugin extends Bundle implements PluginInterface { /** * @param array $configs * @param ContainerBuilder $container */ - public function load(array $configs, ContainerBuilder $container) + public function load(array $configs, ContainerBuilder $container) : void { $extension = new GuzzleBundleOAuth2Extension(); $extension->load($configs, $container); @@ -38,7 +38,7 @@ public function load(array $configs, ContainerBuilder $container) * @param string $clientName * @param Definition $handler */ - public function loadForClient(array $config, ContainerBuilder $container, string $clientName, Definition $handler) + public function loadForClient(array $config, ContainerBuilder $container, string $clientName, Definition $handler) : void { if ($config['enabled']) { $middlewareConfig = [ @@ -141,7 +141,7 @@ public function loadForClient(array $config, ContainerBuilder $container, string /** * @param ArrayNodeDefinition $pluginNode */ - public function addConfiguration(ArrayNodeDefinition $pluginNode) + public function addConfiguration(ArrayNodeDefinition $pluginNode) : void { $pluginNode ->canBeEnabled() diff --git a/tests/DependencyInjection/GuzzleBundleOAuth2ExtensionTest.php b/tests/DependencyInjection/GuzzleBundleOAuth2ExtensionTest.php index a5b0d84..7ab191d 100644 --- a/tests/DependencyInjection/GuzzleBundleOAuth2ExtensionTest.php +++ b/tests/DependencyInjection/GuzzleBundleOAuth2ExtensionTest.php @@ -9,7 +9,7 @@ class GuzzleBundleOAuth2ExtensionTest extends TestCase { - public function testLoad() + public function testLoad() : void { $container = new ContainerBuilder(); diff --git a/tests/GuzzleBundleOAuth2PluginTest.php b/tests/GuzzleBundleOAuth2PluginTest.php index d8470a7..497bf36 100644 --- a/tests/GuzzleBundleOAuth2PluginTest.php +++ b/tests/GuzzleBundleOAuth2PluginTest.php @@ -3,7 +3,7 @@ namespace Gregurco\Bundle\GuzzleBundleOAuth2Plugin\Test; use EightPoints\Bundle\GuzzleBundle\DependencyInjection\Configuration; -use EightPoints\Bundle\GuzzleBundle\EightPointsGuzzleBundlePlugin; +use EightPoints\Bundle\GuzzleBundle\PluginInterface; use Gregurco\Bundle\GuzzleBundleOAuth2Plugin\GuzzleBundleOAuth2Plugin; use Sainsburys\Guzzle\Oauth2\GrantType\ClientCredentials; use Sainsburys\Guzzle\Oauth2\GrantType\GrantTypeInterface; @@ -24,20 +24,20 @@ class GuzzleBundleOAuth2PluginTest extends TestCase /** @var GuzzleBundleOAuth2Plugin */ protected $plugin; - public function setUp() + public function setUp() : void { parent::setUp(); $this->plugin = new GuzzleBundleOAuth2Plugin(); } - public function testSubClassesOfPlugin() + public function testSubClassesOfPlugin() : void { - $this->assertInstanceOf(EightPointsGuzzleBundlePlugin::class, $this->plugin); + $this->assertInstanceOf(PluginInterface::class, $this->plugin); $this->assertInstanceOf(Bundle::class, $this->plugin); } - public function testAddConfiguration() + public function testAddConfiguration() : void { $arrayNode = new ArrayNodeDefinition('node'); @@ -69,12 +69,12 @@ public function testAddConfiguration() ); } - public function testGetPluginName() + public function testGetPluginName() : void { $this->assertEquals('oauth2', $this->plugin->getPluginName()); } - public function testLoad() + public function testLoad() : void { $container = new ContainerBuilder(); @@ -87,7 +87,7 @@ public function testLoad() ); } - public function testLoadForClient() + public function testLoadForClient() : void { $handler = new Definition(); $container = new ContainerBuilder(); @@ -120,7 +120,7 @@ public function testLoadForClient() $this->assertCount(3, $clientMiddlewareDefinition->getArguments()); } - public function testLoadForClientWithPrivateKey() + public function testLoadForClientWithPrivateKey() : void { $handler = new Definition(); $container = new ContainerBuilder(); @@ -163,7 +163,7 @@ public function testLoadForClientWithPrivateKey() * * @param array $pluginConfiguration */ - public function testAddConfigurationWithData(array $pluginConfiguration) + public function testAddConfigurationWithData(array $pluginConfiguration) : void { $config = [ 'eight_points_guzzle' => [ @@ -239,7 +239,7 @@ public function provideValidConfigurationData() : array * @param array $pluginConfiguration * @param string $message */ - public function testAddConfigurationWithInvalidData(array $pluginConfiguration, string $message) + public function testAddConfigurationWithInvalidData(array $pluginConfiguration, string $message) : void { $this->expectException(InvalidConfigurationException::class); $this->expectExceptionMessage($message);