Skip to content

Commit

Permalink
Support Symfony 7
Browse files Browse the repository at this point in the history
  • Loading branch information
gregurco committed Dec 4, 2023
1 parent b890cc8 commit 3fd437a
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 58 deletions.
21 changes: 7 additions & 14 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,17 @@ 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.*'
- '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 }}

Expand Down
16 changes: 8 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
44 changes: 12 additions & 32 deletions src/DataCollector/DataCollectorSymfonyCompatibilityTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
1 change: 0 additions & 1 deletion src/DataCollector/HttpDataCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 1 addition & 2 deletions src/EightPointsGuzzleBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -57,7 +56,7 @@ public function getContainerExtension() : ExtensionInterface
}

/**
* @inheritdoc
* {@inheritdoc}
*/
public function boot()
{
Expand Down
2 changes: 1 addition & 1 deletion src/Log/DevNullLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class DevNullLogger implements LoggerInterface
use LoggerTrait;

/**
* @inheritDoc
* {@inheritdoc}
*/
public function log($level, $message, array $context = []): void
{
Expand Down

0 comments on commit 3fd437a

Please sign in to comment.