diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index 83b9e53..acafda8 100644 --- a/.github/workflows/phpunit.yml +++ b/.github/workflows/phpunit.yml @@ -12,24 +12,18 @@ jobs: matrix: os: [ubuntu-latest] php: - - '7.1' - - '7.4' - - '8.0' - - '8.1' + - '7.2' + - '8.3' symfony: - - '4.4.*' - '5.0.*' - - '5.4.*' + - '5.4.*' # LTS - '6.0.*' + - '7.0.*' exclude: - - php: '7.1' - symfony: '5.0.*' # requires PHP ^7.2.5 - - php: '7.1' - symfony: '5.4.*' # requires PHP ^7.2.5 - - php: '7.1' - symfony: '6.0.*' # requires PHP ^7.2.5 - - php: '7.4' - symfony: '6.0.*' # requires PHP ^8.0.2 + - php: '7.2' + symfony: '6.0.*' # requires PHP >=8.1 + - php: '7.2' + symfony: '7.0.*' # requires PHP >=8.2 runs-on: ${{ matrix.os }} diff --git a/README.md b/README.md index 15a8e71..7586d50 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ GuzzleBundle follows semantic versioning. Read more on [semver.org][2]. ## Prerequisites - PHP 7.1 or higher - - Symfony 4.x or 5.x or 6.x + - Symfony 5.x or 6.x or 7.x ---- diff --git a/composer.json b/composer.json index f1354e6..b6eb75a 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "eightpoints/guzzle-bundle", "type": "symfony-bundle", - "description": "Integrates Guzzle 6.x, a PHP HTTP Client, into Symfony 2/3/4. Comes with easy and powerful configuration options and optional plugins.", + "description": "Integrates Guzzle 6.x, a PHP HTTP Client, into Symfony. Comes with easy and powerful configuration options and optional plugins.", "keywords": [ "bundle", "guzzle", @@ -26,20 +26,20 @@ } ], "require": { - "php": ">=7.1", + "php": ">=7.2", "guzzlehttp/guzzle": "^6.5.8|^7.4.5", "guzzlehttp/promises": "^1.5.3|^2.0", "guzzlehttp/psr7": "^1.9.1|^2.5", - "symfony/framework-bundle": "~4.0|~5.0|~6.0", - "symfony/expression-language": "~4.0|~5.0|~6.0", - "symfony/stopwatch": "~4.0|~5.0|~6.0", + "symfony/framework-bundle": "~5.0|~6.0|~7.0", + "symfony/expression-language": "~5.0|~6.0|~7.0", + "symfony/stopwatch": "~5.0|~6.0|~7.0", "psr/log": "~1.0|~2.0|~3.0" }, "require-dev": { - "symfony/phpunit-bridge": "~4.0|~5.0|~6.0", - "symfony/twig-bundle": "~4.0|~5.0|~6.0", - "symfony/var-dumper": "~4.0|~5.0|~6.0", - "symfony/yaml": "~4.0|~5.0|~6.0" + "symfony/phpunit-bridge": "~5.0|~6.0|~7.0", + "symfony/twig-bundle": "~5.0|~6.0|~7.0", + "symfony/var-dumper": "~5.0|~6.0|~7.0", + "symfony/yaml": "~5.0|~6.0|~7.0" }, "suggest": { "namshi/cuzzle": "Outputs Curl command on profiler's page for debugging purposes" diff --git a/src/DataCollector/DataCollectorSymfonyCompatibilityTrait.php b/src/DataCollector/DataCollectorSymfonyCompatibilityTrait.php index 9b36a3d..33f3006 100644 --- a/src/DataCollector/DataCollectorSymfonyCompatibilityTrait.php +++ b/src/DataCollector/DataCollectorSymfonyCompatibilityTrait.php @@ -4,40 +4,20 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpKernel\Kernel; -/** - * @TODO remove this trait with dropping of support Symfony < 4.4 - */ +trait DataCollectorSymfonyCompatibilityTrait +{ + abstract protected function doCollect(Request $request, Response $response, \Throwable $exception = null); -if (Kernel::VERSION_ID >= 40308) { - trait DataCollectorSymfonyCompatibilityTrait + /** + * @param Request $request + * @param Response $response + * @param \Throwable|null $exception + * + * @return void + */ + public function collect(Request $request, Response $response, \Throwable $exception = null) { - abstract protected function doCollect(Request $request, Response $response, \Throwable $exception = null); - - /** - * @param Request $request - * @param Response $response - * @param \Throwable|null $exception - */ - public function collect(Request $request, Response $response, \Throwable $exception = null) - { - $this->doCollect($request, $response, $exception); - } - } -} else { - trait DataCollectorSymfonyCompatibilityTrait - { - abstract protected function doCollect(Request $request, Response $response, \Throwable $exception = null); - - /** - * @param Request $request - * @param Response $response - * @param \Exception|null $exception - */ - public function collect(Request $request, Response $response, \Exception $exception = null) - { - $this->doCollect($request, $response, $exception); - } + $this->doCollect($request, $response, $exception); } } diff --git a/src/DataCollector/HttpDataCollector.php b/src/DataCollector/HttpDataCollector.php index 91038d8..3007c5f 100644 --- a/src/DataCollector/HttpDataCollector.php +++ b/src/DataCollector/HttpDataCollector.php @@ -3,7 +3,6 @@ namespace EightPoints\Bundle\GuzzleBundle\DataCollector; use EightPoints\Bundle\GuzzleBundle\Log\LogGroup; -use EightPoints\Bundle\GuzzleBundle\Log\LoggerInterface; use EightPoints\Bundle\GuzzleBundle\Log\LogMessage; use Psr\Log\LogLevel; use Symfony\Component\HttpKernel\DataCollector\DataCollector; diff --git a/src/EightPointsGuzzleBundle.php b/src/EightPointsGuzzleBundle.php index 67cd9a7..5787c18 100644 --- a/src/EightPointsGuzzleBundle.php +++ b/src/EightPointsGuzzleBundle.php @@ -3,7 +3,6 @@ namespace EightPoints\Bundle\GuzzleBundle; use EightPoints\Bundle\GuzzleBundle\DependencyInjection\EightPointsGuzzleExtension; -use EightPoints\Bundle\GuzzleBundle\DependencyInjection\Compiler\EventHandlerCompilerPass; use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException; use Symfony\Component\HttpKernel\Bundle\Bundle; use Symfony\Component\DependencyInjection\ContainerBuilder; @@ -57,7 +56,9 @@ public function getContainerExtension() : ExtensionInterface } /** - * @inheritdoc + * {@inheritdoc} + * + * @return void */ public function boot() { diff --git a/src/Events/Event.php b/src/Events/Event.php index 836be62..6411f2a 100644 --- a/src/Events/Event.php +++ b/src/Events/Event.php @@ -2,10 +2,7 @@ namespace EightPoints\Bundle\GuzzleBundle\Events; -use Symfony\Component\EventDispatcher\Event as BaseEvent; -use Symfony\Component\EventDispatcher\EventDispatcher; -use Symfony\Contracts\EventDispatcher\Event as ContractsBaseEvent; -use Symfony\Contracts\EventDispatcher\EventDispatcherInterface; +use Symfony\Contracts\EventDispatcher\Event as BaseEvent; /** * @see: https://github.com/8p/EightPointsGuzzleBundle/pull/261 @@ -13,13 +10,9 @@ * * SF 4.3 introduced Contracts and deprecated interfaces used before. * This file is a layer to support different versions and don't cause deprecation messages. + * + * @TODO remove that file in the next major release */ -if (is_subclass_of(EventDispatcher::class, EventDispatcherInterface::class)) { - class Event extends ContractsBaseEvent - { - } -} else { - class Event extends BaseEvent - { - } +class Event extends BaseEvent +{ } diff --git a/src/Log/DevNullLogger.php b/src/Log/DevNullLogger.php index 9ffcd8b..08be768 100644 --- a/src/Log/DevNullLogger.php +++ b/src/Log/DevNullLogger.php @@ -12,7 +12,7 @@ class DevNullLogger implements LoggerInterface use LoggerTrait; /** - * @inheritDoc + * {@inheritdoc} */ public function log($level, $message, array $context = []): void {