Skip to content

Commit 341950b

Browse files
authored
Merge pull request #13 from php-vcr/symfony5
Add Symfony 5 compatibility
2 parents e6c3787 + 5895759 commit 341950b

File tree

4 files changed

+12
-14
lines changed

4 files changed

+12
-14
lines changed

DataCollector/VCRDataCollector.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
use Symfony\Component\HttpFoundation\Request;
66
use Symfony\Component\HttpFoundation\Response;
77
use Symfony\Component\HttpKernel\DataCollector\DataCollector;
8-
98
use VCR\VCRBundle\VCR\Logger;
109

1110
class VCRDataCollector extends DataCollector
@@ -17,7 +16,7 @@ public function __construct(Logger $logger)
1716
$this->logger = $logger;
1817
}
1918

20-
public function collect(Request $request, Response $response, \Exception $exception = null)
19+
public function collect(Request $request, Response $response, \Throwable $exception = null)
2120
{
2221
$requests = $this->logger->getHttpRequests();
2322
$playbacks = $this->logger->getPlaybacks();

DependencyInjection/Configuration.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ public function __construct(array $factories = array())
1717

1818
public function getConfigTreeBuilder()
1919
{
20-
$treeBuilder = new TreeBuilder();
21-
$rootNode = $treeBuilder->root('vcrvcr');
20+
$treeBuilder = new TreeBuilder('vcrvcr');
21+
$rootNode = $treeBuilder->getRootNode();
2222

2323
$this->addCassetteNode($rootNode);
2424

README.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,17 @@ Install the behavior adding `php-vcr/vcr-bundle` to your composer.json or
1414
from CLI:
1515

1616
```bash
17-
php composer.phar require php-vcr/vcr-bundle
17+
composer require php-vcr/vcr-bundle
1818
```
1919

20-
And declare the bundle in your `app/AppKernel.php` file:
20+
And declare the bundle in your `config/bundles.php` file:
2121

2222
```php
23-
public function registerBundles()
24-
{
25-
if (in_array($this->getEnvironment(), array('dev', 'test'))) {
26-
$bundles[] = new VCR\VCRBundle\VCRVCRBundle();
27-
}
28-
}
23+
return [
24+
// ...
25+
VCR\VCRBundle\VCRVCRBundle::class => ['test' => true],
26+
];
27+
2928
```
3029

3130
## Configuration reference

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
}
1111
],
1212
"require": {
13-
"symfony/framework-bundle": "~2.6||~3.0||~4.0",
14-
"php-vcr/php-vcr": "~1.2"
13+
"symfony/framework-bundle": "~3.0||~4.0||~5.0",
14+
"php-vcr/php-vcr": "^1.5"
1515
},
1616
"autoload": {
1717
"psr-4": {

0 commit comments

Comments
 (0)